> i have a table that has two date fields (dateinx and dateoutx) and i
> need to find all the results for todays date that both fall between
> and on that date for a given customer: cID.

This should be fairly simple to add to your existing query...

AND GETDATE() BETWEEN dateinx AND dateoutx

> database is msSQL2005 ... i am using "smalldatetime" in
> msSQL2005 and also would like to create a mask so that
> only date: 1/1/2012 would be saved.
> same for time: 1:30AM in a seperate field. msSQL is saving
> now as 1/1/2012 01:30:00AM or some such...

SQL Server has different data types for "date" and "time" which would
store these values on their own (internally I believe they're still
stored as a "smalldatetime" with static values for the unused portion.
 You can also look up the datepart() T-SQL function to break out a
datetime into its component parts when needed.

> WHERE (cID = #cID#) AND ....

Also make sure you put a CFQUERYPARAM tag around that cID variable as
well to prevent SQL injection, among other benefits.


-Justin

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353335
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to