By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,455 Members | 2,157 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,455 IT Pros & Developers. It's quick & easy.

Format a joined date time field in a query

P: 7
Table has a date field formatted as a short date dd/mm/yy, and a time field formatted as short time hh:nn. When I join those fields in a query
ie. Date_Time:[Date]&"_"&[Time] the result is displayed as dd/mm/yyyy_hh:nn:ss in the query and the chart that is attached to it. I only want dd/mm/yy_hh:nn to be displayed.
How can i change it. I have tried to format the joined field, and either and the query does not run or it makes no difference to the output.

thankyou

Brian
Apr 17 '10 #1

✓ answered by NeoPa

Brian,

I'd like to start by recommending strongly that you find other names than [Date] & [Time] to use in your project. While they work in most circumstances, they are reserved words, and as such should be avoided for names.

For your query, I would suggest an alternative of :
Expand|Select|Wrap|Line Numbers
  1. Date_Time: Format([Date]+[Time],'dd/mm/yy\_hh:nn')
Welcome to Bytes!

Share this Question
Share on Google+
4 Replies


P: 7
SOLVED:- The trick is
Date_Time:Format[Date]&"_"&[Time],"dd/mm/yy"&"_"&"hh:mm")
Apr 18 '10 #2

NeoPa
Expert Mod 15k+
P: 31,186
Brian,

I'd like to start by recommending strongly that you find other names than [Date] & [Time] to use in your project. While they work in most circumstances, they are reserved words, and as such should be avoided for names.

For your query, I would suggest an alternative of :
Expand|Select|Wrap|Line Numbers
  1. Date_Time: Format([Date]+[Time],'dd/mm/yy\_hh:nn')
Welcome to Bytes!
Apr 20 '10 #3

P: 7
@NeoPa
Thank you NeoPa that works and is more elegant than my solution.
Brian
Apr 21 '10 #4

NeoPa
Expert Mod 15k+
P: 31,186
Thank you. Always pleased to help :)
Apr 21 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.