RE: querying for dates mssql.

2005-10-14 Thread Justin D. Scott
 I need a query that will return all records that are
 set to expire ( column name toexpire - which is just
 a date ) in the next 7 days.

 select * from mytable 
 where toexpire ???

WHERE toexpire  getdate()
AND toexpire = DATEADD(dd, 7, getdate())


-Justin Scott



~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:221011
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: querying for dates mssql.

2005-10-14 Thread Bobby Hartsfield
Mysql has date_add and adddate (and tons more date function) should be
pretty easy.

Check here
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
bookmark it...bookmark it... bookmark it

 
..:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com

-Original Message-
From: Protoculture [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 14, 2005 6:37 AM
To: CF-Talk
Subject: querying for dates mssql.

I need a query that will return all records that are set to expire ( column
name toexpire - which is just a date ) in the next 7 days.

select * from mytable 
where toexpire ???



~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:221014
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: querying for dates mssql.

2005-10-14 Thread Daniel Kang
You can simply compare now () +7 against toexpire.

Daniel

On 10/14/05, Protoculture [EMAIL PROTECTED] wrote:
 I need a query that will return all records that are set to expire ( column 
 name toexpire - which is just a date ) in the next 7 days.

 select * from mytable
 where toexpire ???

 

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:221016
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54