Showing posts with label figure. Show all posts
Showing posts with label figure. Show all posts

Friday, March 30, 2012

Query process time

I have a weird issue that I just can't figure out. I have a query that runs on tables that are all located in db x. If I run the query under a different db (like use database y) then it runs in like 11 seconds. If I run the query under the db that all of the tables reside under (use database x) then it takes almost 4 minutes.

Why would it take so much longer to run under the db where all of the data/tables exists? Both dbs are on the same SQL 2005 server.

I just don't get it?

Any ideas?

S

We can't possibly give you a meaningful response without having more information. What is the query, what is the nature of the data, what is different between the two databases, etc.

Perhaps, using your description about, database X has data in it, and database Y does not?

|||If you think that execution plan will be same then why SQl statement take different time on different server. But have you checked the CPU Cost and I/O cost.

Monday, March 26, 2012

Query Problem

I have the following query that is giving me an error that I can't quite
figure out. The error I get is Server: Msg 8624, Level 16, State 3, Line 11
Internal SQL Server error. I think it is related to the sub-query or the
group by. The sub-query executes successfully if I run it by itself.
Any Ideas as to what I can try?
Thanks
Jeff
Declare @.StartDate VarChar(12)
SET @.StartDate = '04/07/03'
SELECT Plant, COUNT(Distinct PERSONFULLNAME) AS EmployeeCount, Period,
@.StartDate as StartDate
FROM (SELECT A.PERSONFULLNAME, C.LABORLEVELDSC1 AS PLANT,
CASE
WHEN A.APPLYDATE BETWEEN DateAdd(Day, 42, @.StartDate) And
DateAdd(Day, 55, @.StartDate) Then 'This Pay Period'
WHEN A.APPLYDATE BETWEEN DateAdd(Day, 28, @.StartDate) And
DateAdd(Day, 41, @.StartDate) Then 'Last Pay Period'
WHEN A.APPLYDATE BETWEEN DateAdd(Day, 00, @.StartDate) And
DateAdd(Day, 55, @.StartDate) Then 'Last 4 Pay Periods'
/* WHEN A.APPLYDATE BETWEEN DateAdd(Day, 00, @.StartDate)
And DateAdd(Day, 13, @.StartDate) Then 4 */
End AS Period
FROM VP_ALLTOTALS AS A, VP_EMPLOYEE AS B, VP_LABORACCOUNT AS C
WHERE A.WFCLABORLEVELNAME1 = C.LABORLEVELNAME1
AND A.WFCLABORLEVELNAME2 = C.LABORLEVELNAME2
AND A.WFCLABORLEVELNAME3 = C.LABORLEVELNAME3
AND A.WFCLABORLEVELNAME4 = C.LABORLEVELNAME4
AND A.EMPLOYEEID = B.EMPLOYEEID
AND B.PayRuleName <> 'All Exempt'
AND A.APPLYDATE Between DateAdd(Day, 0, @.StartDate) And
DateAdd(Day, 55, @.StartDate)
GROUP BY A.PERSONFULLNAME, C.LABORLEVELDSC1, A.APPLYDATE) AS TEST
GROUP BY Plant, Period
ORDER BY Plant, Period DESCI found the problem.
Thanks
Jeff
"Jeff Cichocki" <jeffc@.belgioioso.com> wrote in message
news:OyvRuYWDGHA.2320@.TK2MSFTNGP11.phx.gbl...
>I have the following query that is giving me an error that I can't quite
>figure out. The error I get is Server: Msg 8624, Level 16, State 3, Line 11
>Internal SQL Server error. I think it is related to the sub-query or the
>group by. The sub-query executes successfully if I run it by itself.
> Any Ideas as to what I can try?
> Thanks
> Jeff
>
> Declare @.StartDate VarChar(12)
> SET @.StartDate = '04/07/03'
> SELECT Plant, COUNT(Distinct PERSONFULLNAME) AS EmployeeCount, Period,
> @.StartDate as StartDate
> FROM (SELECT A.PERSONFULLNAME, C.LABORLEVELDSC1 AS PLANT,
> CASE
> WHEN A.APPLYDATE BETWEEN DateAdd(Day, 42, @.StartDate) And
> DateAdd(Day, 55, @.StartDate) Then 'This Pay Period'
> WHEN A.APPLYDATE BETWEEN DateAdd(Day, 28, @.StartDate) And
> DateAdd(Day, 41, @.StartDate) Then 'Last Pay Period'
> WHEN A.APPLYDATE BETWEEN DateAdd(Day, 00, @.StartDate) And
> DateAdd(Day, 55, @.StartDate) Then 'Last 4 Pay Periods'
> /* WHEN A.APPLYDATE BETWEEN DateAdd(Day, 00, @.StartDate)
> And DateAdd(Day, 13, @.StartDate) Then 4 */
> End AS Period
> FROM VP_ALLTOTALS AS A, VP_EMPLOYEE AS B, VP_LABORACCOUNT AS C
> WHERE A.WFCLABORLEVELNAME1 = C.LABORLEVELNAME1
> AND A.WFCLABORLEVELNAME2 = C.LABORLEVELNAME2
> AND A.WFCLABORLEVELNAME3 = C.LABORLEVELNAME3
> AND A.WFCLABORLEVELNAME4 = C.LABORLEVELNAME4
> AND A.EMPLOYEEID = B.EMPLOYEEID
> AND B.PayRuleName <> 'All Exempt'
> AND A.APPLYDATE Between DateAdd(Day, 0, @.StartDate) And
> DateAdd(Day, 55, @.StartDate)
> GROUP BY A.PERSONFULLNAME, C.LABORLEVELDSC1, A.APPLYDATE) AS TEST
> GROUP BY Plant, Period
> ORDER BY Plant, Period DESC
>|||Hi Jeff,
Do you still know what the solution for your problem was? I get this error
also:
Server: Msg 8624, Level 16, State 3, Line 1
According to MSFT i should install the latest SP but that did not help.
Thanks,
STanley
"Jeff Cichocki" wrote:
> I found the problem.
> Thanks
> Jeff
> "Jeff Cichocki" <jeffc@.belgioioso.com> wrote in message
> news:OyvRuYWDGHA.2320@.TK2MSFTNGP11.phx.gbl...
> >I have the following query that is giving me an error that I can't quite
> >figure out. The error I get is Server: Msg 8624, Level 16, State 3, Line 11
> >Internal SQL Server error. I think it is related to the sub-query or the
> >group by. The sub-query executes successfully if I run it by itself.
> >
> > Any Ideas as to what I can try?
> >
> > Thanks
> >
> > Jeff
> >
> >
> >
> > Declare @.StartDate VarChar(12)
> > SET @.StartDate = '04/07/03'
> >
> > SELECT Plant, COUNT(Distinct PERSONFULLNAME) AS EmployeeCount, Period,
> > @.StartDate as StartDate
> > FROM (SELECT A.PERSONFULLNAME, C.LABORLEVELDSC1 AS PLANT,
> > CASE
> > WHEN A.APPLYDATE BETWEEN DateAdd(Day, 42, @.StartDate) And
> > DateAdd(Day, 55, @.StartDate) Then 'This Pay Period'
> > WHEN A.APPLYDATE BETWEEN DateAdd(Day, 28, @.StartDate) And
> > DateAdd(Day, 41, @.StartDate) Then 'Last Pay Period'
> > WHEN A.APPLYDATE BETWEEN DateAdd(Day, 00, @.StartDate) And
> > DateAdd(Day, 55, @.StartDate) Then 'Last 4 Pay Periods'
> > /* WHEN A.APPLYDATE BETWEEN DateAdd(Day, 00, @.StartDate)
> > And DateAdd(Day, 13, @.StartDate) Then 4 */
> > End AS Period
> > FROM VP_ALLTOTALS AS A, VP_EMPLOYEE AS B, VP_LABORACCOUNT AS C
> > WHERE A.WFCLABORLEVELNAME1 = C.LABORLEVELNAME1
> > AND A.WFCLABORLEVELNAME2 = C.LABORLEVELNAME2
> > AND A.WFCLABORLEVELNAME3 = C.LABORLEVELNAME3
> > AND A.WFCLABORLEVELNAME4 = C.LABORLEVELNAME4
> > AND A.EMPLOYEEID = B.EMPLOYEEID
> > AND B.PayRuleName <> 'All Exempt'
> > AND A.APPLYDATE Between DateAdd(Day, 0, @.StartDate) And
> > DateAdd(Day, 55, @.StartDate)
> > GROUP BY A.PERSONFULLNAME, C.LABORLEVELDSC1, A.APPLYDATE) AS TEST
> > GROUP BY Plant, Period
> > ORDER BY Plant, Period DESC
> >
>
>

Friday, March 23, 2012

Query plan question

Is there a way we can figure out if the query optimiser is using a
particular stat/s ( Non indexed specifically ) to determine a query plan ?
I understand when missing stats are noticed, its obviously looking for it
but if we dont see any, can we tell if its looking at some non indexed stats
to come to a conclusion .
Also how does update stats affect performance on a highly OLTP system ? Does
it include blocking ,etc. ?sql server will use any stats available,
make a table, populate one column with unique values, but
not indexed, then query against it, notice that the
execution plan will have a fairly accurate estimate of the
expected row count, even though it is scanning the entire
table
stats will matter if it influences the plan, notice that
loop joins may exhibit a spike in plan cost at ~130 rows,
so there is a tendency to shift to scan
>--Original Message--
>Is there a way we can figure out if the query optimiser
is using a
>particular stat/s ( Non indexed specifically ) to
determine a query plan ?
>I understand when missing stats are noticed, its
obviously looking for it
>but if we dont see any, can we tell if its looking at
some non indexed stats
>to come to a conclusion .
>Also how does update stats affect performance on a highly
OLTP system ? Does
>it include blocking ,etc. ?
>
>.
>|||> sql server will use any stats available,
> make a table, populate one column with unique values, but
> not indexed, then query against it, notice that the
> execution plan will have a fairly accurate estimate of the
> expected row count, even though it is scanning the entire
> table
When does this happen ? When does it make this table you referred to ? Is
this at the time of update stats or create stats or every time a query runs
.
You also mentioned that it will use any stats available. Does it even use
those that may not be needed ?
> loop joins may exhibit a spike in plan cost at ~130 rows,
> so there is a tendency to shift to scan
What scan are you talking about ?
"joe chang" <jchang6@.yahoo.com> wrote in message
news:0ea901c37281$fd521af0$a001280a@.phx.gbl...
> sql server will use any stats available,
> make a table, populate one column with unique values, but
> not indexed, then query against it, notice that the
> execution plan will have a fairly accurate estimate of the
> expected row count, even though it is scanning the entire
> table
> stats will matter if it influences the plan, notice that
> loop joins may exhibit a spike in plan cost at ~130 rows,
> so there is a tendency to shift to scan
> >--Original Message--
> >Is there a way we can figure out if the query optimiser
> is using a
> >particular stat/s ( Non indexed specifically ) to
> determine a query plan ?
> >I understand when missing stats are noticed, its
> obviously looking for it
> >but if we dont see any, can we tell if its looking at
> some non indexed stats
> >to come to a conclusion .
> >
> >Also how does update stats affect performance on a highly
> OLTP system ? Does
> >it include blocking ,etc. ?
> >
> >
> >.
> >|||the following white paper contains a good description of the statistics
framework in SQL Server 2000 and probably answers all your questions.
http://msdn.microsoft.com/library/default.asp?URL=/library/techart/statquery.htm
Peter Zabback
SQL Server Development
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:OFA7oOocDHA.1696@.TK2MSFTNGP10.phx.gbl...
> > sql server will use any stats available,
> > make a table, populate one column with unique values, but
> > not indexed, then query against it, notice that the
> > execution plan will have a fairly accurate estimate of the
> > expected row count, even though it is scanning the entire
> > table
> When does this happen ? When does it make this table you referred to ? Is
> this at the time of update stats or create stats or every time a query
runs
> .
> You also mentioned that it will use any stats available. Does it even use
> those that may not be needed ?
> > loop joins may exhibit a spike in plan cost at ~130 rows,
> > so there is a tendency to shift to scan
> What scan are you talking about ?
> "joe chang" <jchang6@.yahoo.com> wrote in message
> news:0ea901c37281$fd521af0$a001280a@.phx.gbl...
> > sql server will use any stats available,
> > make a table, populate one column with unique values, but
> > not indexed, then query against it, notice that the
> > execution plan will have a fairly accurate estimate of the
> > expected row count, even though it is scanning the entire
> > table
> > stats will matter if it influences the plan, notice that
> > loop joins may exhibit a spike in plan cost at ~130 rows,
> > so there is a tendency to shift to scan
> >
> > >--Original Message--
> > >Is there a way we can figure out if the query optimiser
> > is using a
> > >particular stat/s ( Non indexed specifically ) to
> > determine a query plan ?
> > >I understand when missing stats are noticed, its
> > obviously looking for it
> > >but if we dont see any, can we tell if its looking at
> > some non indexed stats
> > >to come to a conclusion .
> > >
> > >Also how does update stats affect performance on a highly
> > OLTP system ? Does
> > >it include blocking ,etc. ?
> > >
> > >
> > >.
> > >
>

Monday, March 12, 2012

Query output as text rather than a temp table..

Hi Guys,

I'm trying to figure out how to output a query as text instead of a tempory table...

I thought perhaps i could use this:

SELECT PRINT CustomerID FROM ORDER_TABLE

But that doesn't work

PRINT CustomerID FROM ORDER_TABLE

Doesn't work either...

I need this so i can print a customised invoice in SQL. That is, unless their is a better way of tackling this problem?

thx for reading :)

--PhilkillsWhere does "SELECT CustomerID FROM ORDER_TABLE" write its output to?|||That generates a tempory table with a heading of 'CustomerID' and row numbers at the left hand side....

Im talking about just outputing the data in the customerID column... and nothing else :p

The same way you would do:

PRINT 'BLAH'

etc...|||That generates a tempory table with a heading of 'CustomerID' and row numbers at the left hand side....you can be assuered that it isn't a temporary table and it doesn't have line numbers -- your front end app is doing that

what database is this? (notice you have posted in the standard sql forum)|||Its for MSSQL

and i found 1 potential way...

storing the output in a buffer:

DECLARE @.ordNo INT
DECLARE @.outBuff VARCHAR(1000)
DECLARE @.newLine CHAR(1)
SET @.ordNo = 1
SET @.outBuff = ''
SET @.newLine = '
'

SELECT @.outBuff = @.outBuff + 'PRICE: ' + CAST(ItemPrice AS VARCHAR) + @.newLine
FROM ORDER_ITEM, ITEM
WHERE ORDER_ITEM.ItemID = ITEM.ItemID

PRINT @.outBuff

But is there a better way?|||moved to SQL Server forum

Wednesday, March 7, 2012

Query on date/time data type

I need everthing from 1AM to 10:55AM. Can't figure out the syntax.
Need from "2006-10-24 01:00:00" to "2006-10-24 10:55:00"
I've been trying CONVERT and CAST but to no avail. There's no examples on
how to utilize the TIME part of this smalldatetime data type.
Thx,
Don
SQL2000
WHERE ( MyDateTimeColumn >= '2006-10-24 01:00:00'
AND MyDateTimeColumn <= '2006-10-24 10:55:00'
)
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the top yourself.
- H. Norman Schwarzkopf
"donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message news:D64028F9-5CA6-4D40-8B10-5D6AEB90CDCE@.microsoft.com...
>I need everthing from 1AM to 10:55AM. Can't figure out the syntax.
> Need from "2006-10-24 01:00:00" to "2006-10-24 10:55:00"
> I've been trying CONVERT and CAST but to no avail. There's no examples on
> how to utilize the TIME part of this smalldatetime data type.
> Thx,
> Don
> SQL2000
>
|||DOH! )
I was trying to make it too compliated!
Thanks!
Don
"Arnie Rowland" wrote:
[vbcol=seagreen]
> WHERE ( MyDateTimeColumn >= '2006-10-24 01:00:00'
> AND MyDateTimeColumn <= '2006-10-24 10:55:00'
> )
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
> You can't help someone get up a hill without getting a little closer to the top yourself.
> - H. Norman Schwarzkopf
>
> "donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message news:D64028F9-5CA6-4D40-8B10-5D6AEB90CDCE@.microsoft.com...
|||I recommend that you use either of below two formats for the datetime strings:
'20061024 01:00:00'
'2006-10-24T01:00:00'
If you use any other format, the app will be language dependent
(http://www.karaszi.com/SQLServer/inf...asp#DtFormats). as shown below:
SET LANGUAGE german
SELECT CAST('2006-10-24 01:00:00' AS datetime)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
news:98D78D54-EFF9-4097-BBD5-80D338D2663F@.microsoft.com...[vbcol=seagreen]
> DOH! )
> I was trying to make it too compliated!
> Thanks!
> Don
>
> "Arnie Rowland" wrote:

Query on date/time data type

I need everthing from 1AM to 10:55AM. Can't figure out the syntax.
Need from "2006-10-24 01:00:00" to "2006-10-24 10:55:00"
I've been trying CONVERT and CAST but to no avail. There's no examples on
how to utilize the TIME part of this smalldatetime data type.
Thx,
Don
SQL2000WHERE ( MyDateTimeColumn >= '2006-10-24 01:00:00'
AND MyDateTimeColumn <= '2006-10-24 10:55:00'
)
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message news:D64028F9-5CA6-4D
40-8B10-5D6AEB90CDCE@.microsoft.com...
>I need everthing from 1AM to 10:55AM. Can't figure out the syntax.
>
> Need from "2006-10-24 01:00:00" to "2006-10-24 10:55:00"
>
> I've been trying CONVERT and CAST but to no avail. There's no examples on
> how to utilize the TIME part of this smalldatetime data type.
>
> Thx,
> Don
> SQL2000
>
>|||DOH! )
I was trying to make it too compliated!
Thanks!
Don
"Arnie Rowland" wrote:
[vbcol=seagreen]
> WHERE ( MyDateTimeColumn >= '2006-10-24 01:00:00'
> AND MyDateTimeColumn <= '2006-10-24 10:55:00'
> )
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
> You can't help someone get up a hill without getting a little closer to th
e top yourself.
> - H. Norman Schwarzkopf
>
> "donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message new
s:D64028F9-5CA6-4D40-8B10-5D6AEB90CDCE@.microsoft.com...|||I recommend that you use either of below two formats for the datetime string
s:
'20061024 01:00:00'
'2006-10-24T01:00:00'
If you use any other format, the app will be language dependent
(http://www.karaszi.com/SQLServer/in...e.asp#DtFormats). as shown bel
ow:
SET LANGUAGE german
SELECT CAST('2006-10-24 01:00:00' AS datetime)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
news:98D78D54-EFF9-4097-BBD5-80D338D2663F@.microsoft.com...[vbcol=seagreen]
> DOH! )
> I was trying to make it too compliated!
> Thanks!
> Don
>
> "Arnie Rowland" wrote:
>

Query on date/time data type

I need everthing from 1AM to 10:55AM. Can't figure out the syntax.
Need from "2006-10-24 01:00:00" to "2006-10-24 10:55:00"
I've been trying CONVERT and CAST but to no avail. There's no examples on
how to utilize the TIME part of this smalldatetime data type.
Thx,
Don
SQL2000This is a multi-part message in MIME format.
--=_NextPart_000_06CE_01C6F760.251370F0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: quoted-printable
WHERE ( MyDateTimeColumn >=3D '2006-10-24 01:00:00' AND MyDateTimeColumn <=3D '2006-10-24 10:55:00'
)
-- Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience. Most experience comes from bad judgment. - Anonymous
You can't help someone get up a hill without getting a little closer to =the top yourself.
- H. Norman Schwarzkopf
"donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message =news:D64028F9-5CA6-4D40-8B10-5D6AEB90CDCE@.microsoft.com...
>I need everthing from 1AM to 10:55AM. Can't figure out the syntax.
> > Need from "2006-10-24 01:00:00" to "2006-10-24 10:55:00"
> > I've been trying CONVERT and CAST but to no avail. There's no examples =on > how to utilize the TIME part of this smalldatetime data type.
> > Thx,
> Don
> SQL2000
> >
--=_NextPart_000_06CE_01C6F760.251370F0
Content-Type: text/html;
charset="Utf-8"
Content-Transfer-Encoding: quoted-printable
=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

WHERE ( =MyDateTimeColumn >=3D '2006-10-24 01:00:00'
AND MyDateTimeColumn <=3D '2006-10-24 10:55:00'
)
-- Arnie Rowland, =Ph.D.Westwood Consulting, Inc
Most good judgment comes from =experience. Most experience comes from bad judgment. - Anonymous
You can't help someone get up a hill =without getting a little closer to the top yourself.- H. Norman Schwarzkopf
"donsql22222" wrote in message news:D64028F9-5CA6-4D40-8B10-5D6AEB90CDCE@.microsoft.com...>I =need everthing from 1AM to 10:55AM. Can't figure out the syntax.> > Need =from "2006-10-24 01:00:00" to "2006-10-24 10:55:00"> > I've =been trying CONVERT and CAST but to no avail. There's no examples on > how to =utilize the TIME part of this smalldatetime data type.> > =Thx,> Don> SQL2000> >

--=_NextPart_000_06CE_01C6F760.251370F0--|||DOH! :))
I was trying to make it too compliated!
Thanks!
Don
"Arnie Rowland" wrote:
> WHERE ( MyDateTimeColumn >= '2006-10-24 01:00:00'
> AND MyDateTimeColumn <= '2006-10-24 10:55:00'
> )
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
> You can't help someone get up a hill without getting a little closer to the top yourself.
> - H. Norman Schwarzkopf
>
> "donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message news:D64028F9-5CA6-4D40-8B10-5D6AEB90CDCE@.microsoft.com...
> >I need everthing from 1AM to 10:55AM. Can't figure out the syntax.
> >
> > Need from "2006-10-24 01:00:00" to "2006-10-24 10:55:00"
> >
> > I've been trying CONVERT and CAST but to no avail. There's no examples on
> > how to utilize the TIME part of this smalldatetime data type.
> >
> > Thx,
> > Don
> > SQL2000
> >
> >|||I recommend that you use either of below two formats for the datetime strings:
'20061024 01:00:00'
'2006-10-24T01:00:00'
If you use any other format, the app will be language dependent
(http://www.karaszi.com/SQLServer/info_datetime.asp#DtFormats). as shown below:
SET LANGUAGE german
SELECT CAST('2006-10-24 01:00:00' AS datetime)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
news:98D78D54-EFF9-4097-BBD5-80D338D2663F@.microsoft.com...
> DOH! :))
> I was trying to make it too compliated!
> Thanks!
> Don
>
> "Arnie Rowland" wrote:
>> WHERE ( MyDateTimeColumn >= '2006-10-24 01:00:00'
>> AND MyDateTimeColumn <= '2006-10-24 10:55:00'
>> )
>> --
>> Arnie Rowland, Ph.D.
>> Westwood Consulting, Inc
>> Most good judgment comes from experience.
>> Most experience comes from bad judgment.
>> - Anonymous
>> You can't help someone get up a hill without getting a little closer to the top yourself.
>> - H. Norman Schwarzkopf
>>
>> "donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
>> news:D64028F9-5CA6-4D40-8B10-5D6AEB90CDCE@.microsoft.com...
>> >I need everthing from 1AM to 10:55AM. Can't figure out the syntax.
>> >
>> > Need from "2006-10-24 01:00:00" to "2006-10-24 10:55:00"
>> >
>> > I've been trying CONVERT and CAST but to no avail. There's no examples on
>> > how to utilize the TIME part of this smalldatetime data type.
>> >
>> > Thx,
>> > Don
>> > SQL2000
>> >
>> >