Showing posts with label point. Show all posts
Showing posts with label point. Show all posts

Thursday, March 22, 2012

Calculated columns...

Hello,
can anyone help me with this?
SELECT (A+B) AS X FROM TABLE WHERE X = 'sqdf'
The point here is, if I use the following query
SELECT (A+B) AS X FROM TABLE WHERE (A+B) = 'sqdf'
the thing works, but for programming-technical reasons a have to use X
SELECT (A+B) AS X FROM TABLE WHERE X = 'sqdf'
What's wrong here?
Regards,
Kurt RogiersWHERE is evaluated before the field list, meaning that when you run
this, there is no column named "X" when the WHERE clause is evaluated.
Something like this will achieve the desired effect:
SELECT X
FROM (SELECT (A+B) AS X FROM TABLE) AS calcX
WHERE X = 'sqdf'
Kurt Rogiers wrote:
> Hello,
> can anyone help me with this?
> SELECT (A+B) AS X FROM TABLE WHERE X = 'sqdf'
> The point here is, if I use the following query
> SELECT (A+B) AS X FROM TABLE WHERE (A+B) = 'sqdf'
> the thing works, but for programming-technical reasons a have to use X
> SELECT (A+B) AS X FROM TABLE WHERE X = 'sqdf'
> What's wrong here?
> Regards,
> Kurt Rogiers|||You cannot use column aliases like this. You can only reference a column
alias in an ORDER BY clause, or outside of an inline query.
You can change the way you are coding this, to eliminate the "
programming-technical reasons " that require you to use "X".
You can also try one of these approaches:
select X from
(
SELECT (A+B) AS X FROM TABLE
)
where X = 'sqdf'
Create view MyView as
SELECT (A+B) AS X FROM TABLE
select X from MyView where X='sqdf'
"Kurt Rogiers" <k.rogiers@.skynet.be> wrote in message
news:%23jLUu%23viGHA.4056@.TK2MSFTNGP02.phx.gbl...
> Hello,
> can anyone help me with this?
> SELECT (A+B) AS X FROM TABLE WHERE X = 'sqdf'
> The point here is, if I use the following query
> SELECT (A+B) AS X FROM TABLE WHERE (A+B) = 'sqdf'
> the thing works, but for programming-technical reasons a have to use X
> SELECT (A+B) AS X FROM TABLE WHERE X = 'sqdf'
> What's wrong here?
> Regards,
> Kurt Rogiers
>|||Hello,
life can be SOOO easy!!!
Thanks a lot, the solution works wonderful
Regard,
Kurt
"Jim Underwood" <james.underwoodATfallonclinic.com> schreef in bericht
news:O%23wf3IwiGHA.1936@.TK2MSFTNGP04.phx.gbl...
> You cannot use column aliases like this. You can only reference a column
> alias in an ORDER BY clause, or outside of an inline query.
> You can change the way you are coding this, to eliminate the "
> programming-technical reasons " that require you to use "X".
> You can also try one of these approaches:
> select X from
> (
> SELECT (A+B) AS X FROM TABLE
> )
> where X = 'sqdf'
>
> Create view MyView as
> SELECT (A+B) AS X FROM TABLE
> select X from MyView where X='sqdf'
>
> "Kurt Rogiers" <k.rogiers@.skynet.be> wrote in message
> news:%23jLUu%23viGHA.4056@.TK2MSFTNGP02.phx.gbl...
>sql

Tuesday, March 20, 2012

Calculate mean meadian and mode?

Hi all
Is there a way to calculate mean, median and mode as in Crystal? If so could
you point me to a source, I am not much on programming but willing to give
that a go if I have to.
thanks.In the current release of RS there is not a way to do this - I'm not sure if
RS 2005 will have this capability.
I had to calculate median values for a report that I designed and ended up
having to do the calculations in a stored procedure that my dataset was
using. You stated that you're not to up on programming so I'll tell you the
theory behind what I did and if you want the source I'll be glad to send it
to you.
Basically to get the median value for a dataset what you need to do is total
up the number of rows for the dataset/table and divide by 2. Once you have
that value all you have to do then is go in and retrieve the value that
resides at that row number and that will give you the median value.
hth,
Bill Youngman
Anexinet, Inc.
"darwin" <darwin@.discussions.microsoft.com> wrote in message
news:A6FD67C6-41BE-43A9-B89C-F690EDE564D4@.microsoft.com...
> Hi all
> Is there a way to calculate mean, median and mode as in Crystal? If so
could
> you point me to a source, I am not much on programming but willing to give
> that a go if I have to.
> thanks.
>

Sunday, March 11, 2012

CAL License Question

I know that the number of CALs licensed to a given server is stored in some
system table because at one point I had and ran a script to provide that
information. But I either didn't keep the script or didn't name it well as
I
cannot find it. Does anyone know how to query to find this information?Hi,
From Query Analyzer you can Execute
select SERVERPROPERTY('LicenseType')
select SERVERPROPERTY('NumLicenses')
FYI, CALS are not stored in any system table.
Thanks
Hari
SQL Server MVP
"RKinder" <RKinder@.discussions.microsoft.com> wrote in message
news:D22C57DA-4CA4-41CF-B9B7-EE1F8ADDED03@.microsoft.com...
> I know that the number of CALs licensed to a given server is stored in
some
> system table because at one point I had and ran a script to provide that
> information. But I either didn't keep the script or didn't name it well
as I
> cannot find it. Does anyone know how to query to find this information?|||Thank You.
For whatever reason I'm getting Disabled and Null, but I can look into that.
Thanks again.
"Hari Prasad" wrote:

> Hi,
> From Query Analyzer you can Execute
>
> select SERVERPROPERTY('LicenseType')
> select SERVERPROPERTY('NumLicenses')
> FYI, CALS are not stored in any system table.
> Thanks
> Hari
> SQL Server MVP
> "RKinder" <RKinder@.discussions.microsoft.com> wrote in message
> news:D22C57DA-4CA4-41CF-B9B7-EE1F8ADDED03@.microsoft.com...
> some
> as I
>
>|||RKinder wrote:
> Thank You.
> For whatever reason I'm getting Disabled and Null, but I can look
> into that. Thanks again.
>
I believe that's a known issue prior to SP2. What service pack are you
running?
http://support.microsoft.com/defaul...KB;en-us;291332
David Gugick
Imceda Software
www.imceda.com

CAL License Question

I know that the number of CALs licensed to a given server is stored in some
system table because at one point I had and ran a script to provide that
information. But I either didn't keep the script or didn't name it well as I
cannot find it. Does anyone know how to query to find this information?Hi,
From Query Analyzer you can Execute
select SERVERPROPERTY('LicenseType')
select SERVERPROPERTY('NumLicenses')
FYI, CALS are not stored in any system table.
Thanks
Hari
SQL Server MVP
"RKinder" <RKinder@.discussions.microsoft.com> wrote in message
news:D22C57DA-4CA4-41CF-B9B7-EE1F8ADDED03@.microsoft.com...
> I know that the number of CALs licensed to a given server is stored in
some
> system table because at one point I had and ran a script to provide that
> information. But I either didn't keep the script or didn't name it well
as I
> cannot find it. Does anyone know how to query to find this information?|||Thank You.
For whatever reason I'm getting Disabled and Null, but I can look into that.
Thanks again.
"Hari Prasad" wrote:
> Hi,
> From Query Analyzer you can Execute
>
> select SERVERPROPERTY('LicenseType')
> select SERVERPROPERTY('NumLicenses')
> FYI, CALS are not stored in any system table.
> Thanks
> Hari
> SQL Server MVP
> "RKinder" <RKinder@.discussions.microsoft.com> wrote in message
> news:D22C57DA-4CA4-41CF-B9B7-EE1F8ADDED03@.microsoft.com...
> > I know that the number of CALs licensed to a given server is stored in
> some
> > system table because at one point I had and ran a script to provide that
> > information. But I either didn't keep the script or didn't name it well
> as I
> > cannot find it. Does anyone know how to query to find this information?
>
>|||RKinder wrote:
> Thank You.
> For whatever reason I'm getting Disabled and Null, but I can look
> into that. Thanks again.
>
I believe that's a known issue prior to SP2. What service pack are you
running?
http://support.microsoft.com/default.aspx?scid=KB;en-us;291332
--
David Gugick
Imceda Software
www.imceda.com

CAL License Question

I know that the number of CALs licensed to a given server is stored in some
system table because at one point I had and ran a script to provide that
information. But I either didn't keep the script or didn't name it well as I
cannot find it. Does anyone know how to query to find this information?
Hi,
From Query Analyzer you can Execute
select SERVERPROPERTY('LicenseType')
select SERVERPROPERTY('NumLicenses')
FYI, CALS are not stored in any system table.
Thanks
Hari
SQL Server MVP
"RKinder" <RKinder@.discussions.microsoft.com> wrote in message
news:D22C57DA-4CA4-41CF-B9B7-EE1F8ADDED03@.microsoft.com...
> I know that the number of CALs licensed to a given server is stored in
some
> system table because at one point I had and ran a script to provide that
> information. But I either didn't keep the script or didn't name it well
as I
> cannot find it. Does anyone know how to query to find this information?
|||Thank You.
For whatever reason I'm getting Disabled and Null, but I can look into that.
Thanks again.
"Hari Prasad" wrote:

> Hi,
> From Query Analyzer you can Execute
>
> select SERVERPROPERTY('LicenseType')
> select SERVERPROPERTY('NumLicenses')
> FYI, CALS are not stored in any system table.
> Thanks
> Hari
> SQL Server MVP
> "RKinder" <RKinder@.discussions.microsoft.com> wrote in message
> news:D22C57DA-4CA4-41CF-B9B7-EE1F8ADDED03@.microsoft.com...
> some
> as I
>
>
|||RKinder wrote:
> Thank You.
> For whatever reason I'm getting Disabled and Null, but I can look
> into that. Thanks again.
>
I believe that's a known issue prior to SP2. What service pack are you
running?
http://support.microsoft.com/default...B;en-us;291332
David Gugick
Imceda Software
www.imceda.com

Saturday, February 25, 2012

CAB Files

Can anyone Please point me to a place that I can find some documentation on what the sql.ppc.wce5.armv4i.CAB does?

I basically need to know which files are being placed in the handset by deplyoing the CAB file.

Thanks,

Farnaz

The cab file contents are documented here: http://www.microsoft.com/sql/editions/sqlmobile/installsdk.mspx

Friday, February 24, 2012

C# code or document for loading excel sheet into an sql table

Hi,

I am trying to find some document or code that will load an excel spreadsheet into an sqlserver database.

Can anyone please point me in the right direction.http://www.databasejournal.com/features/mssql/article.php/3331881|||Thanks a lot for your help I will take a look at this now.

Tuesday, February 14, 2012

But the documentation is NOT correct

The documentation says

ISNUMERIC returns 1 when the input expression evaluates to a valid
integer, floating point number, money or decimal type; otherwise it
returns 0. A return value of 1 guarantees that expression can be
converted to one of these numeric types.

(Cut and pasted from books online)

Yet the following, one of many, example shows this is not true.

select isnumeric(char(9))
select convert(int, char(9))

----
1

(1 row(s) affected)

Server: Msg 245, Level 16, State 1, Line 2
Syntax error converting the varchar value '' to a column of data type
int.

So, besides filtering every possible invalid character, how do you
convert dirty values without error. I am not concerned that I may loose
possibly valid values or convert suspect strings to 0 (zero). I just
want to run without raising an errorBooks Online is quite correct here, it just could be a bit clearer. The
significant word in the paragraph you posted is "or". ISNUMERIC returns
1 if the data is convertible to ANY of the datatypes listed. Try the
following, which will work:

SELECT CONVERT(MONEY, CHAR(9))

If you just want to convert positive integers then you can use LIKE to
determine whether a string contains only numerics:

SELECT CAST(col AS INTEGER)
FROM YourTable
WHERE col NOT LIKE '%[^0-9]%'

--
David Portas
SQL Server MVP
--|||By inference then CONVERT(MONEY, x) is the most 'tolerant' conversion.
Strings containing only numerics is also elegant.

Thanks for the tip|||(bilbo.baggins@.freesurf.ch) writes:
> By inference then CONVERT(MONEY, x) is the most 'tolerant' conversion.

Not necessarily:

SELECT convert(money, '1E1')

bombs. But isnumeric() returns 1.

isnumeric is a useless function.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Friday, February 10, 2012

Bullet Points in Textbox

I have some bullet-pointed text I need to add to a text box such as
* Line 1
* Line 2
* Line 3
I see the formatting toolbar has a bullet point icon, but it is always
disabled for me. How can I format text in a textbox so that it is bullet
pointed?
Thanks,
ChrisHi Chris,
Thank you for your posting.
You could not format the text with bullet point in the reporting services
design time directly.
One workaround is you type the text in the word document and then copy
paste the text into the textbox in reporting services.
Hope this will be helpful! Thank you!
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.