Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2005

Tip: Looking for answers? Try searching our database.

Linking date data types in a query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Parts Maker - 04 Nov 2005 23:43 GMT
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!
David Lloyd - 05 Nov 2005 02:29 GMT
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)

Signature

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!
Parts Maker - 05 Nov 2005 03:52 GMT
David,

Thank you much.  That worked perfectly.

> 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
[quoted text clipped - 13 lines]
> are expecting.  Let me know if there is a way to get it to work.  Thanks
> much!
KARL DEWEY - 05 Nov 2005 02:41 GMT
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.

> 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!
Parts Maker - 05 Nov 2005 03:48 GMT
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;

> There are a couple of ways.  The simplest is to first use a query the output
> the date without any time part.  
[quoted text clipped - 12 lines]
> > 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!
Parts Maker - 05 Nov 2005 03:54 GMT
Please dis-regard my last message.  I got an answer.  Thank you for your help.

> There are a couple of ways.  The simplest is to first use a query the output
> the date without any time part.  
[quoted text clipped - 12 lines]
> > 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!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.