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

Host with the leader in ColdFusion hosting. 
Voted #1 ColdFusion host by CF Developers. 
Offering shared and dedicated hosting options. 
www.cfxhosting.com/default.cfm?redirect=10481

                        

Reply via email to