- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Date formatting in Number Edit Box
Hi,
I'm trying to get my date formatted in a particular way.
I've already looked at http://www.jmp.com/support/help/Date-Time_Functions_and_Formats.shtml for the formatting but see no option that is appropriate for the format I need.
Currently I have it set as follows:
startDate = As Date( Today() - 86400 ); //get current time for yesterday
startDateEB = Number Edit Box( startDate, 10 );
startDateEB << Set Format( Format( "yyyy-mm-dd" ) );
Which gives boxes like this:
The contents of this number edit box is inserted into a query later on(so needs to be in a format like 2017-11-28 07:30:00), and the above works fine when wanting to query data for entire days, but when you want to pull a specific window of time it doesn't allow for this.
I've attempted changing the Set Format(Format()) paramaters
startDateEB << Set Format( Format( "yyyy-mm-dd hh:mm" ) );
But Format won't accept this and just returns the numeric value of the date-time.
Is there some warkaround for this?
Or a different approach entirely?
Thanks in advance.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Date formatting in Number Edit Box
Try putting a T between the date and time portion.
startDateEB << Set Format( Format( "yyyy-mm-ddThh:mm:ss" ) );
From the Numeric Formats section of the help page for the Column Info dialog box (text edit boxes use the same formats):
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Date formatting in Number Edit Box
Try putting a T between the date and time portion.
startDateEB << Set Format( Format( "yyyy-mm-ddThh:mm:ss" ) );
From the Numeric Formats section of the help page for the Column Info dialog box (text edit boxes use the same formats):
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Date formatting in Number Edit Box
I thought the SQL query would be unable to deal with the T but had no impact.