| Author |
Message |
Macavity
Groupie
Joined: 24 Sep 2012
Online Status: Offline
Posts: 93
|

Topic: datepart Posted: 07 Jan 2014 at 3:12am |
|
Probably a silly question, but found in an old report : fromdate : date(2010,datepart("m",currentdate),01) todate : date(2011,datepart("m",currentdate)-11,1)
what does the ,01 mean in fromdate what does the -11,1 mean in todate
thanks
|
IP Logged |
|
|
|
kevlray
Admin Group
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
|

Posted: 07 Jan 2014 at 4:23am |
|
The 01 is part of the date function. Thus is is for the first day of the month or in this case the first day of the current month. The -11, 1 will go back 11 months to the first day of month which would not make sense unless you notice that the fromdate starts in 2010 and the todate is in 2011. Seems a bit of odd logic, but it apparently worked for who ever designed the report.
|
IP Logged |
|
Macavity
Groupie
Joined: 24 Sep 2012
Online Status: Offline
Posts: 93
|

Posted: 07 Jan 2014 at 6:18am |
|
can't see that could have worked in January, that would result in month = -10
well I was just curious, couldn't see the logic of it
thanks
|
IP Logged |
|
|
|