Converting date time format to mm/dd/yyy format
-
- BronzeLounger
- Posts: 1391
- Joined: 08 Jul 2016, 18:53
Converting date time format to mm/dd/yyy format
I've got a day/time field that I would like to convert to mm/dd/yyyy format in a grouping query. Tradedate: Int(Day([NinjaTrader2024_PA].[Time])) and I received a group of days. So I'd like the specific format mm/dd/yyyy. Is there a format instead of concat 3 date/times with 2 "/" between them?
-
- BronzeLounger
- Posts: 1391
- Joined: 08 Jul 2016, 18:53
Re: Converting date time format to mm/dd/yyy format
Never mind I just removed the Day and got a m/dd/yyyy format which should be fine. Tradedate: Int(([NinjaTrader2024_PA].[Time])) formatting the field to short date.
-
- 2StarLounger
- Posts: 104
- Joined: 22 Feb 2022, 09:04
Re: Converting date time format to mm/dd/yyy format
I used to use this format constant for my dates.
Code: Select all
Public Const strcJetDate = "\#yyyy-mm-dd\#" 'Needed for dates in queries as Access expects USA but will accept ISO format.
Using Access 2007/2019.
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
Please, please use code tags when posting code snippets, click the </>icon.
Debug.Print is your lifesaver.
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
Please, please use code tags when posting code snippets, click the </>icon.
Debug.Print is your lifesaver.
-
- BronzeLounger
- Posts: 1391
- Joined: 08 Jul 2016, 18:53
Re: Converting date time format to mm/dd/yyy format
Will that expression work in a query?Gasman wrote: ↑24 Feb 2024, 20:54I used to use this format constant for my dates.Code: Select all
Public Const strcJetDate = "\#yyyy-mm-dd\#" 'Needed for dates in queries as Access expects USA but will accept ISO format.
-
- 2StarLounger
- Posts: 104
- Joined: 22 Feb 2022, 09:04
Re: Converting date time format to mm/dd/yyy format
I don't know, let me check.
No.
I actually only ever used it for VBA.
Then again a simple "mm/dd/yyyy" works in queries, so the complexity is never needed in queries, just in VBA?
No.
I actually only ever used it for VBA.
Then again a simple "mm/dd/yyyy" works in queries, so the complexity is never needed in queries, just in VBA?
Using Access 2007/2019.
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
Please, please use code tags when posting code snippets, click the </>icon.
Debug.Print is your lifesaver.
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
Please, please use code tags when posting code snippets, click the </>icon.
Debug.Print is your lifesaver.