oops i got that all wrong, but i think you got the point; check the BoL for
BETWEEN if not.

Sorry
BTC

>|> -----Original Message-----
>|> From: Bradford T Comer [mailto:[EMAIL PROTECTED]
>|> Sent: Tuesday, June 03, 2003 4:37 PM
>|> To: SQL
>|> Subject: RE: Help : selecting records using a date range>
>|>
>|>
>|> Try Between, it works great for this...
>|>
>|> DECLARE @CurrentDate datetime
>|> SET @CurrentDate = getDate()
>|>
>|> SELECT * FROM tbl_test
>|> WHERE CAST(Posted_Start AS datetime) BETWEEN CAST(Posted_End AS
>|> datetime)
>|> AND @CurrentDate
>|>
>|> Or something similiar...i may be off, i thas been awhile...
>|>
>|> BTC
>|>
>|> >|> -----Original Message-----
>|> >|> From: Bosky, Dave [mailto:[EMAIL PROTECTED]
>|> >|> Sent: Tuesday, June 03, 2003 3:00 PM
>|> >|> To: SQL
>|> >|> Subject: Help : selecting records using a date range>
>|> >|>
>|> >|>
>|> >|> I was trying to retrieve a list of records using a date range
>|> >|> in SQL Server
>|> >|> but can't seem to get the desired results.
>|> >|> *** Posted_Start, Posted_End are VarChar types.***
>|> >|>
>|> >|> DECLARE @CurrentDate datetime
>|> >|> SET @CurrentDate = getDate()
>|> >|>
>|> >|> SELECT * FROM tbl_test
>|> >|> WHERE @CurrentDate >= CAST(Posted_Start AS datetime)
>|> >|> AND CAST(Posted_End AS datetime) < @CurrentDate
>|> >|>
>|> >|> Any help would be nice!
>|> >|>
>|> >|> Thanks,
>|> >|> Dave
>|> >|>
>|> >|>
>|> >|>
>|> >|>
>|> >|>
>|> >|> HTC Disclaimer:  The information contained in this message may
>|> >|> be privileged and confidential and protected from disclosure.
>|> >|> If the reader of this message is not the intended recipient, or
>|> >|> an employee or agent responsible for delivering this message to
>|> >|> the intended recipient, you are hereby notified that any
>|> >|> dissemination, distribution or copying of this communication is
>|> >|> strictly prohibited.  If you have received this communication
>|> >|> in error, please notify us immediately by replying to the
>|> >|> message and deleting it from your computer.  Thank you.
>|> >|>
>|> >|>
>|> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=6
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=6

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

                        

Reply via email to