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
 General SQL Server Forums
 New to SQL Server Programming
 @timestamp

Author  Topic 

satheesh
Posting Yak Master

152 Posts

Posted - 2011-09-07 : 07:01:39
Dear All,

In report subscriptions , I am using @timestamp in my file names.It produces the file name with date and time.
I just need the date, not time.Is any other options avaliable.

eg:

Just -> 2011_09_07

Not -> 2011_09_07_100201

Any help is highly appreciated


Regards,
SG

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-07 : 07:03:57
use dateadd(dd,datediff(dd,0,@timestamp),0)

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

satheesh
Posting Yak Master

152 Posts

Posted - 2011-09-07 : 07:21:03
Thanks for your reply visakh.its not in script,i mean in SQL reporting services
under Report Delivery Option, i am using @timestamp in file name column.
It produce file with date and time.for eg : 2011_09_07_100201.csv

I just want to produce the file with only date ie.2011_09_07.csv

Thanks in advance.

Regards,
SG


Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-09 : 02:42:23
you can apply same logic. change the synatx as per definition of dateadd and datediff in reporting services

DATEADD(DAY,DATEDIFF(DAY,#1/1/1900#,@timestamp),#1/1/1900#)

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -