Home > Archive > MS SQL Server MSEQ > February 2006 > Datetime Selection II









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Datetime Selection II
Stan

2006-02-06, 8:25 pm

I posted this earlier and got an unusable answer, so I'm trying again...
I have a table with a transaction date of datatype datetime. I need to
select all where where the transaction date is 2 days ago. If I use
"where transaction date = (getdate( ) -2)" the selection fails because of, I
think, the time portion of each field. How can I compare two datetime
datatypes based only on the date portion?
Thank you!
--
Stan Gosselin
Hugo Kornelis

2006-02-06, 8:25 pm

On Mon, 6 Feb 2006 14:46:25 -0800, Stan wrote:

>I posted this earlier and got an unusable answer, so I'm trying again...
>I have a table with a transaction date of datatype datetime. I need to
>select all where where the transaction date is 2 days ago. If I use
>"where transaction date = (getdate( ) -2)" the selection fails because of, I
>think, the time portion of each field. How can I compare two datetime
>datatypes based only on the date portion?
>Thank you!


Hi Stan,

I posted a reply to your original post, half an hour after you sent this
copy of the message (but before I saw it).

Was it useful?

--
Hugo Kornelis, SQL Server MVP
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com