Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable Datestamp

Status
Not open for further replies.

sg458

IS-IT--Management
May 26, 2009
1
Hello,
I have created a report which contains the data from the first of the actual month till yesterday. This report starts automatically every night and overwrites the old report.
Now my question:
In the headline I want to document the space of time the report belongs to.
For example: The Report runs tonight (26.05.2009). So the date in the header should be 01.05.2009 till 25.05.2009.
What is the instruction for this query?
 
try

Code:
Select convert(varchar(12),getdate()-day(getdate())+1)+'-'+convert(varchar(12),convert(varchar(12),getdate()-1))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top