Jump to content
We've recently updated our Privacy Statement, available here ×

Date Format MM/dd/yyyy Returning single Digit Months/Days


H27790

Recommended Posts

I have strings, startDate, endDate, showStartDate, and showEndDate. Any text field I use them in will dislay 01/01/2020 12:00AM as 1/1/2020 12:00AM. I just want 01/01/2020. Nothing I have done, including use of 'Pattern' in the field settings, has changed the format. What else can I try?

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

If the field was a date datatype then you can use the pattern "M/dd/yyyy".

Since the incoming field is a fixed-length string you can grab the first 10 characters:

MID("01/01/2020 12:00AM",1,10)[/code]

@luked suggestion gives you the most flexibility.  Converting the field to the proper datatype in SQL then you can use pattern and later if you need to do date calculations you can do that with no effort.

Link to comment
Share on other sites

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...