Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Exporting table based on current Date

Author  Topic 

ahouse
Starting Member

27 Posts

Posted - 2007-05-09 : 12:27:15
I am relatively new to the DTS so this may be a very easy question for someone to answer.

I'm trying to export from a table only items that have a create date of yesterday or today. For example I have : Invoices.CreateDate as my table and field name. The items in the CreateDate field have the following format. 2007-05-08 8:29:00.233000000

I was trying to somehow create the query criteria to only return things with a date greater than 2007-05-08 but because it isn't a numeric field, it can't be compared like that.

Any suggestions?

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-05-10 : 05:36:18
where datecol>=Dateadd(day,datediff(day,0,getdate()),-1)

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -