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
 SQL Server Development (2000)
 Looking to get a SQL statement

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-09-25 : 08:16:16
Robert writes "Hello Guys,
I have scheduled a SQL Job to run daily and export a text file to a local directory. the only problem I have is building the right Select statement. I would like a select staement that produce all the data i have collected from the previous day to be in this text file. I can schedule the job,but i can't get the right "SELECT STATEMENT' to produce all the data, including colums from the previous day to show in the text file. For example, If i collect data all day on Tuesday, I would like to see all this data from Tuesday appear in the text file on Wednesday when i review the content. Every day the job will produce the text file to the same location with the data from the previous day. I really would appreciate the help guys, of course, only a rookie would ask something like this :-)"

samsekar
Constraint Violating Yak Guru

437 Posts

Posted - 2003-09-25 : 08:43:19
Why can't you write Select Statement which selects from previous day
Can you please post the table structure and show sample data..
I am sure somebody will help you.

- Sekar
Go to Top of Page

dsdeming

479 Posts

Posted - 2003-09-25 : 08:43:22
You need a WHERE clause like:

WHERE DATEDIFF( dd, YourDateColumn, GETDATE() ) = 1

Without more detail as to your table structures, I can't offer much more than that.

Dennis
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2003-09-25 : 08:48:48
you haven't told us:

What you have
- or -
What you want

Those things can be helpful for us !

- Jeff
Go to Top of Page
   

- Advertisement -