Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i join date and time fields within a query without using "&"

Status
Not open for further replies.

whittlep

MIS
Dec 8, 2000
1
GB
- I am trying to run a query that joins a date and time field together so I can check if it is greater than another joined date and time field. I have used the & function but I think that it is converting the field to text so 25/11/0013:00:00 is greater than 01/12/0017:00:00. is there a way of formating the field in the query?

Within the query the fields I have are

field1: [form1].[date] & [form1].[time]
field2: [form2].[date] & [form2].[time]

within another field I am using an iif statement to see if field1 is greater than field2
 
Just to be sure, I did some basic transforms in the debug window:

MyDate = Format(Now, "short date")
MyTime = Format(Now, "Short time")

? MyDate, MyTime
12/8/00 07:44

ThisTime = (MyDate + " " + MyTime)
? Format(ThisTime, "Long Date")
Friday, December 08, 2000

? ThisTime
12/8/00 07:44

? DateValue(ThisTime)
12/8/00

? Format(ThisTime, "General Date")
12/8/00 7:44:00 AM

As you can see in the various 'presentations', you can do a lot with the date and time just using the the general concatenation procedures.




MichaelRed
mred@duvallgroup.com
There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top