sflynn Posted August 12, 2011 Posted August 12, 2011 I'm struggling with formatting the date correctly ... I need the date and time to come up in a calculation with leading zero's in it. I can make it look right in the record via the formatting functions, but when I try and take the date or time from that field and combine it within a calculation, it's dropping the leading zero's. Same thing happens when I use the getdate function. I have a script that strings it all together to form a file name, and I have to keep the zeros. What am I missing? example: I need the timestamp (or a date and time field) to output 08_04_11 for August 4, 2011, not.... 8/4/11. Thanks for any guidance... steve.
comment Posted August 12, 2011 Posted August 12, 2011 Try = SerialIncrement ( "00" ; Month ( YourDate ) ) & SerialIncrement ( "_00" ; Day ( YourDate ) ) & SerialIncrement ( "_00" ; Mod ( Year ( YourDate ) ; 100 ) )
sflynn Posted August 12, 2011 Author Posted August 12, 2011 It's like magic... thanks for waving your wizards wand my way. Can I do the same thing with the time field? Replace "month" with "hour"? etc...
Recommended Posts
This topic is 5221 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now