Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

DateTime properties and methods Expand / Collapse
Author
Message
Posted Tuesday, July 05, 2005 1:47 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Wednesday, June 20, 2012 5:02 AM
Points: 530, Visits: 945
To put today's date in an expression you type 'datetime.today'. How do you express this date last year? There is documentation to suggest that datetime.addyears(-1) might work but it doesn't, at least not immediately. Any ideas?
Post #196884
Posted Tuesday, July 05, 2005 11:37 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, June 05, 2013 2:05 PM
Points: 110, Visits: 44
datetime.today.addyears(-1)
Post #197074
Posted Wednesday, July 06, 2005 1:56 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Wednesday, June 20, 2012 5:02 AM
Points: 530, Visits: 945

brilliant! Now tell me where did you find that out, in BOL? where is the full list of such properties and methods?

thanks.

Post #197279
Posted Wednesday, July 06, 2005 11:06 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, June 05, 2013 2:05 PM
Points: 110, Visits: 44
Actually I just hacked it, meaning I just tried it with that syntax and it worked. LOL.

Now I did a search and found:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemGlobalizationKoreanCalendarClassAddYearsTopic.asp
http://msdn2.microsoft.com/library/991wfdee(en-us,vs.80).aspx
http://msdn2.microsoft.com/library/cw8hzdwz(en-us,vs.80).aspx

This is actually .NET code, not specifically "Reporting Services" code.
Post #197587
Posted Thursday, July 07, 2005 1:52 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Wednesday, June 20, 2012 5:02 AM
Points: 530, Visits: 945
you'd think this sort of thing would be documented somewhere obvious, but... anyway thanks.
Post #197879
Posted Thursday, July 07, 2005 3:50 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 7:47 AM
Points: 1,174, Visits: 2,635

As Greg mentioned the DateTime class (actually System.DateTime) is part of the .NET framework, and is documented here: 

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatetimeclasstopic.asp



--
Nigel
Useful Links:
How to post data/code on a forum to get the best help
The "Numbers" or "Tally" Table - Jeff Moden

Post #197916
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse