date and time comparisons

  • Thread starter Thread starter Al V
  • Start date Start date
A

Al V

I have a form that grabs the date in one field and the
time in another field.
I know want to build a report that will take the latest
transaction for a sales order. That would be a
combination of the two fields.
Can I combine the fields and be able to compare them (if
so how do I do that).
Or, should I just make it one field. I use the date() and
time() functions, but do not know how to make it all one
field.

Any help would be appreciated.

Thanks
Al
 
Al V said:
I have a form that grabs the date in one field and the
time in another field.
I know want to build a report that will take the latest
transaction for a sales order. That would be a
combination of the two fields.
Can I combine the fields and be able to compare them (if
so how do I do that).
Or, should I just make it one field. I use the date() and
time() functions, but do not know how to make it all one
field.

While you *could* combine these two fields as a calculated field in a
query, that's probably not the best approach to take. If you want to
capture *when* something happened, you're usually best off using a
single date/time field. The Now() function returns the date and time
combined, as a single date/time value.
 
I have a form that grabs the date in one field and the
time in another field.

Given the way Access stores Date/Time fields - as a Double Float
number, a count of days and fractions of a day since midnight,
December 30, 1899 - a single field is a lot easier to use.
I know want to build a report that will take the latest
transaction for a sales order. That would be a
combination of the two fields.
Can I combine the fields and be able to compare them (if
so how do I do that).

Just add them: [Datefield] + [Timefield]
Or, should I just make it one field. I use the date() and
time() functions, but do not know how to make it all one
field.

Use the Now() function instead - it give the current date and time.
 
Given the way Access stores Date/Time fields - as a Double Float
number, a count of days and fractions of a day since midnight,
December 30, 1899 - a single field is a lot easier to use.

How Access stores Date/Time columns isn't the real issue. The real
issue is that Access exposes only one DateTime data type. And
Access's DateTime datatype always includes both the date and time.

Other products, including many (most?) legacy systems, support other
date and time data types. Makes for interesting interoperability
problems.
 
Back
Top