Linking date data types in a query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I tried linking date data types in a simple query and it does not seem to
work. The date data types are the same format (short - mm/dd/yyyy). It seems
like the data type may include the hh:mm:ss that you can't see and unless you
have the exact value, down to the second, the query will not return what you
are expecting. Let me know if there is a way to get it to work. Thanks much!
 
I do not have all the specifics of what you are trying to accomplish,
however, if your goal is to just compare the date portion of two dates
without the time value, you can use the Int function. In date values, the
time is represented by the fractional value of the date. Therefore, to
remove the time component (actually just make it the same for all dates),
just round the date to a whole number. For example:

Int(MyFirstDate) = Int(MySecondDate)

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


I tried linking date data types in a simple query and it does not seem to
work. The date data types are the same format (short - mm/dd/yyyy). It
seems
like the data type may include the hh:mm:ss that you can't see and unless
you
have the exact value, down to the second, the query will not return what you
are expecting. Let me know if there is a way to get it to work. Thanks
much!
 
There are a couple of ways. The simplest is to first use a query the output
the date without any time part.
For the output field use MyStrippedDate: CVDate(Int([YourDateField]))
Use the queries and join them.

The second way is to create a query and join. Click on VIEW - SQL View.
You can then edit the join as above.

You can do the same thing for strings the are different lenghts an want to
join on the first so many characters.
 
Thanks Karl. I don't entirely understand. Can you re-state within the
context of my SQL statements below as this is what I am trying to do:

SELECT tblPaintSession.[Serial Number], tblPaintSession.TacType,
tblPaintSession.Date, tblInspectionSession.[Al Adhesion],
tblInspectionSession.Thickness, tblInspectionSession.[QC Date]
FROM tblInspectionSession INNER JOIN tblPaintSession ON
tblInspectionSession.[Paint Date] = tblPaintSession.Date;




KARL DEWEY said:
There are a couple of ways. The simplest is to first use a query the output
the date without any time part.
For the output field use MyStrippedDate: CVDate(Int([YourDateField]))
Use the queries and join them.

The second way is to create a query and join. Click on VIEW - SQL View.
You can then edit the join as above.

You can do the same thing for strings the are different lenghts an want to
join on the first so many characters.

Parts Maker said:
I tried linking date data types in a simple query and it does not seem to
work. The date data types are the same format (short - mm/dd/yyyy). It seems
like the data type may include the hh:mm:ss that you can't see and unless you
have the exact value, down to the second, the query will not return what you
are expecting. Let me know if there is a way to get it to work. Thanks much!
 
Please dis-regard my last message. I got an answer. Thank you for your help.

KARL DEWEY said:
There are a couple of ways. The simplest is to first use a query the output
the date without any time part.
For the output field use MyStrippedDate: CVDate(Int([YourDateField]))
Use the queries and join them.

The second way is to create a query and join. Click on VIEW - SQL View.
You can then edit the join as above.

You can do the same thing for strings the are different lenghts an want to
join on the first so many characters.

Parts Maker said:
I tried linking date data types in a simple query and it does not seem to
work. The date data types are the same format (short - mm/dd/yyyy). It seems
like the data type may include the hh:mm:ss that you can't see and unless you
have the exact value, down to the second, the query will not return what you
are expecting. Let me know if there is a way to get it to work. Thanks much!
 
Back
Top