Date Examples

The following section applies to both "start_date" and "end_date"
 
 
Allowed values for Date boundary (D1)
  • fdm : first day of month
  • ldm : last day of month
  • fdw : first day of week
  • ldw : last day of week
  • fdy : first day of year
  • ldy : last day of year
  • fdq : first day of quarter
  • ldq : last day of quarter
  • today : today's current date
 
Allowed values for Modifier Unit (D3)
  • d = day
  • m = month
 
Allowed values for Modifier Qty (D2)
  • Any positive or negative integer
 
 
Assuming today is 8-Apr-2012 (this page was documented on this date)
 
Dates without modifiers (Note: if D2=0 then D3 is ignored)
 
1. Get first day of current month (note: D2=0)
D1=fdm , D2=0 , D3=d 
["fdm" , "0" , "d"] == "2012-04-01"
 
 
2. Get last day of current month (note:  D2=0)
D1=ldm , D2=0 , D3=d
["ldm" , "0" , "d"] == "2012-04-30"
 
3. Get first day of current year (note:  D2=0)
D1=fdy , D2=0 , D3=d
["fdy" , "0" , "d"] == "2012-01-01"
 
4. Get first day of current year (note:  D2=0)
D1=ldy , D2=0 , D3=d
["ldy" , "0" , "d"] == "2012-12-31"
 
5. Get first day of current quarter (note:  D2=0)
D1=fdq , D2=0 , D3=d
["fdq" , "0" , "d"] == "2012-04-01"
 
6. Get last day of current quarter (note:  D2=0)
D1=ldq , D2=0 , D3=d
["ldq" , "0" , "d"] == "2012-06-30"
 
7. Get first day of current week (note:  D2=0)
D1=fdw , D2=0 , D3=d
["fdw" , "0" , "d"] == "2012-04-08"
 
8. Get last day of current week (note:  D2=0)
D1=ldw , D2=0 , D3=d
["ldw" , "0" , "d"] == "2012-04-14"
 
9. Get today's date (note:  D2=0)
D1=today , D2=0 , D3=m
["today" , "0" , "m"] == "2012-04-08"
 
 
Examples with Day manipulation
 
10. Get first day of current month and add 3 days  (note:  D2=3 and D3 = d, signifying add 3 days )
D1=fdm , D2=3 , D3=d
["fdm" , "3" , "d"] == "2012-04-04"
 
11. Get last day of current month and subtract 3 days  (note:  D2=-3 and D3 = d, signifying subtract 3 days )
D1=ldm , D2=-3 , D3=d
["ldm" , "-3" , "d"] == "2012-04-27"
 
12. Get first day of current year and subtract 5 days  (note:  D2=-5 and D3 = d, signifying subtract 5 days )
D1=fdy , D2=-5 , D3=d
["fdy" , "-5" , "d"] == "2011-12-27"
 
13. Get last day of current year and add 5 days  (note:  D2=5 and D3 = d, signifying add 5 days )
D1=ldy , D2=5 , D3=d
["ldy" , "5" , "d"] == "2013-01-05"
 
14. Get first day of current quarter and add 5 days  (note:  D2=5 and D3 = d, signifying add 5 days )
D1=fdq , D2=5 , D3=d
["fdq" , "5" , "d"] == "2012-04-06"
 
15. Get last day of current quarter and minus 5 days  (note:  D2=-5 and D3 = d, signifying minus 5 days )
D1=ldq , D2=-5 , D3=d
["ldq" , "-5" , "d"] == "2012-06-25"
 
16. Get first day of current week and minus 3 days  (note:  D2=-3 and D3 = d, signifying minus 3 days )
D1=fdw , D2=-3 , D3=d
["fdw" , "-3" , "d"] == "2012-04-05"
 
17. Get last day of current week and add 5 days  (note:  D2=5 and D3 = d, signifying add 5 days )
D1=ldw , D2=5 , D3=d
["ldw" , "5" , "d"] == "2012-04-19"
 
18. Get today's date and go backwards 5 days  (note:  D2=-5 and D3 = d, signifying minus 5 days )
D1=today , D2=-5 , D3=d
["today" , "-5" , "d"] == "2012-04-03"
 
Examples with Month manipulation
 
19. Get first day of current month and add 3 months ie go forward 3 months  (note:  D2=3 and D3 = m, signifying add 3 months )
D1=fdm , D2=3 , D3=m
["fdm" , "3" , "m"] == "2012-07-01"
 
20. Get last day of current month and go backward 3 months  (note:  D2=-3 and D3 = m, signifying subtract 3 months )
D1=ldm , D2=-3 , D3=m
["ldm" , "-3" , "m"] == "2012-01-31"
 
21. Get first day of current year and minus 5 months  (note:  D2=-5 and D3 = m, signifying minus 5 months )
D1=fdy , D2=-5 , D3=m
["fdy" , "-5" , "m"] == "2011-08-01"
 
22. Get last day of current year and add 5 months  (note:  D2=5 and D3 = m, signifying add 5 months )
D1=ldy , D2=5 , D3=m
["ldy" , "5" , "m"] == "2013-05-31"
 
23. Get first day of current quarter and add 5 months  (note:  D2=5 and D3 = m, signifying add 5 months )
D1=fdq , D2=5 , D3=m
["fdq" , "5" , "m"] == "2012-09-01"
 
24. Get last day of current quarter and minus 5 months  (note:  D2=-5 and D3 = m, signifying minus 5 months )
D1=ldq , D2=-5 , D3=m
["ldq" , "-5" , "m"] == "2012-01-30"
 
25. Get first day of current week and minus 3 months  (note:  D2=-3 and D3 = m, signifying minus 3 months )
D1=fdw , D2=-3 , D3=m
["fdw" , "-3" , "m"] == "2012-01-08"
 
26. Get last day of current week and minus 5 months  (note:  D2=-5 and D3 = m, signifying minus 5 months )
D1=ldw , D2=5 , D3=m
["ldw" , "5" , "m"] == "2012-09-14"
 
27. Get today's date and minus 5 months  (note:  D2=-5 and D3 = m, signifying minus 5 months )
D1=today , D2=-5 , D3=m
["today" , "-5" , "m"] == "2011-11-08"
Use online Web Dashboards in the cloud or download and host your own Dashboards