A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query to get information that doesn't match by date



 
 
Thread Tools Display Modes
  #1  
Old February 24th, 2010, 05:36 PM posted to microsoft.public.access.queries
GMC -LSND
external usenet poster
 
Posts: 15
Default Query to get information that doesn't match by date

I have a table named TTIME with columns in it named: Casenum, Tidate,
Reason, Snum
I have a table named CLIENTSCASENOTES with columns: Casenum, CNdate, CNnote,
Snum.

the column TIdate, in the TTIME table stores it's dates as mm/dd/yyyy
the column CNdate, in the CLIENTSCASENOTES tables stores its dates as
mm/dd/yyyy with the time on the end.

What I am trying to do is link the TTIME table with the CLIENTSCASENOTES
table and then get the following out of the query: All the records from
TTIME that do not have a record in the CLIENTSCASENOTES table with date
matching the date on the TTIME record by casenum and by snum.

It is perplexing to me.


  #2  
Old February 24th, 2010, 05:41 PM posted to microsoft.public.access.queries
GMC -LSND
external usenet poster
 
Posts: 15
Default Query to get information that doesn't match by date

I should add this is in Access 2007 linked to a SQL 2008 database.


  #3  
Old February 24th, 2010, 10:30 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Query to get information that doesn't match by date

The format does not matter so long as they both are datatype DateTime.
Use this query to remove the time --
qryClientNotesNewDate --
SELECT DateValue(CLIENTSCASENOTES.CNdate) AS NewDate, CLIENTSCASENOTES.*
FROM CLIENTSCASENOTES;

Then left join the query to TTIME --
SELECT TTIME.Casenum, TTIME.Tidate, TTIME.Reason, TTIME.Snum
FROM TTIME LEFT JOIN qryClientNotesNewDate ON TTIME.Tidate =
qryClientNotesNewDate.NewDate AND TTIME.casenum =
qryClientNotesNewDate.casenum AND TTIME.snum = qryClientNotesNewDate.snum
WHERE qryClientNotesNewDate.NewDate Is Null AND
qryClientNotesNewDate.casenum Is Null AND qryClientNotesNewDate.snum IS Null;

--
Build a little, test a little.


"GMC -LSND" wrote:

I should add this is in Access 2007 linked to a SQL 2008 database.


.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:33 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.