OnDemand Users Group

Support Forums => Report Indexing => Topic started by: mwiese on February 05, 2016, 12:42:31 AM

Title: Date format specifiers
Post by: mwiese on February 05, 2016, 12:42:31 AM
I have a report with dates in the format of Feb 21 2016 and Feb  1 2016.  What date format specifier should I use on the Load Information tab?  I've tried %b %d %Y and %b %e %Y.  I guess I don't understand (and know I can't find the documentation explain) the difference between %3 and %d.  Can anyone enlighten me?  Please?
Title: Re: Date format specifiers
Post by: Justin Derrick on February 05, 2016, 11:41:26 AM
To the best of my knowledge...

%d is a date with leading zeros (ie, "08" "09" "10")

%e is a date without leading zeros ( "8" "9" "10")

It's the same as %m for month with month-with-leading-zero, and %f for month-withOUT-leading-zero.

-JD.
Title: Re: Date format specifiers
Post by: mwiese on February 05, 2016, 01:34:11 PM
Thanks for the info.

%e caused a load failure:

ARS1129E Row 1:  The string "Feb  1 2016" could not be converted to a date from the format of %b %e %Y

%d also failed:
ARS1129E Row 1:  The string "Feb  1 2016" could not be converted to a date from the format of %b %d %Y

I've tried quite a few other combinations which all failed, including removing embedded spaces with %b%e%Y.  I haven't found one that works yet. 

If these are my only options, I'll have to rethink the report design. 
Title: Re: Date format specifiers
Post by: Darrell Bryant on February 23, 2016, 11:15:42 PM
Based on a quick test, the problem is that you have two spaces between the month and the day in the string 'Feb  1 2016'.  Your date format of %b %e %Y only contains one space.
Title: Re: Date format specifiers
Post by: Justin Derrick on February 24, 2016, 02:59:49 PM
The second space belongs to the day-of-the-month field.  It appears to be space-padded, not zero-padded.

I'd almost consider this a bug, since I would expect %e to accept a single-digit day-of-the-month with a space prefix as well as a zero prefix.

-JD.