Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7241 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

So this might be a really basic thing, but my brain just won't move past it, and I could not find anyhting in the forums...

I am doing a .csv export of a set of records for uploading to a state access db. Everything is fine, but on one of my fields the date is formatted as xx/xx/xxxx, when I upload it it shows as xx/xx/xx or worse xx/x/xxx.

I have a calculated set of fields that I run my script through to get the .csv file, and I was curious if there is a way to write a calculation that will take out the first 2 digits of a year

(ex: 1/1/04 instead of 1/1/2004)

Any help would be appreciated,

Thank You

Jesse

  • Newbies
Posted

I tried changing the format of the date, but that just changes how it looks, not how it is stored....

Since I am exporting a portion of the records it grabs all the stored data, not the formatted data..

I figured it out, I had to do this in my calculation for the upload field:

Month (Date Served) & "/" & Day (Date Served) & "/" & Right ( Year (Date Served); 2 )

Thanks for the quick reply though,

Jesse

Posted

If you want to retain leading zeroes,

Right( "0" & Month(Date Served); 2 ) & "/" & Right( "0" & Day(Date Served); 2 ) & "/" & Right( Year(Date Served); 2 )

Posted

Qeue:

That's a beautiful calc. I'm ashamed to say how I've handled this before:

Case(Month(DateServed) < 10, "0" & Month(DateServed), Month(DateServed) ... etc.)

The complicated way is always easy. The simple way can be pretty tough to see sometimes.

Steve Brown

Posted

I used to do worse when forcing leading zeroes. Choose( Length(field) - 1, "0000", "000", "00", "0" ) & field, for example, to force a 5-digit number. Right( "0000" & field, 5 ) is so much easier. Once you learn, you never return. wink.gif

This topic is 7241 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.