Date Query (1 Viewer)

BettyWho

Registered User.
Local time
Today, 06:22
Joined
Jun 7, 2013
Messages
37
Hi Everyone

I've recently come up against a date issue in a query and I am wondering if anyone can help me I've tried several different ways and I'm not getting the result I'd hope for.

What I am trying to do is cross check all the records and only isolate the most current date for each record.

I have this so far

SELECT Max(tClientClosure.Closuredate) AS MaxOfClosuredate, tClientClosure.ClientID
FROM tClientClosure
GROUP BY tClientClosure.ClientID;

It should be a simple query right? Whilst I can get this to run a query when I try and put get a field in a form to look at the particular record data it shows up blank... every other query I have done and implemented has worked this one isn't and it is driving me nuts. :banghead:please help!! Thanks in advance..
 

plog

Banishment Pending
Local time
Today, 08:22
Joined
May 11, 2011
Messages
11,638
when I try and put get a field in a form to look at the particular record data it shows up blank.

Huh? Is this a query or a form issue? If the query is working you might have posted in the wrong sub-forum. But, I don't really understand the above sentence so I don't know where your issue lies.
 

BettyWho

Registered User.
Local time
Today, 06:22
Joined
Jun 7, 2013
Messages
37
eeeek I meant when I try and put the query into a form or the results into a form it doesn't work. That will teach me to try and form sentences in the middle of the night! Anyhow I am not sure if it is the query or the query to field (in the form) which is wrong. I am happy to post the question in the forms section if that is more suitable. thanks!
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:22
Joined
May 7, 2009
Messages
19,233
hi.

do you mean you create new form
from the query and it doesn't work.

or there is an existing form, and you
want to lookup your query against the
form's ClientID.
for a test you can put an unbound
textbox and its controlsource:

if clientID is numeric:
=dlookup("MaxOfClosureDate","yourQueryName","ClientID=" & [ClientID])

if clientID is string:
=dlookup("MaxOfClosureDate","yourQueryName","ClientID=" & Chr(34) & [ClientID] & Chr(34))
 

plog

Banishment Pending
Local time
Today, 08:22
Joined
May 11, 2011
Messages
11,638
There's a simple way to find out where the issue lies---run the query by itself. Does it produce the results you want?
 

BettyWho

Registered User.
Local time
Today, 06:22
Joined
Jun 7, 2013
Messages
37
Thanks very much the string worked.. I have no idea when I put the string in (when I wrote it) that it wouldn't work, but it does now and you are a champ! Thanks very much for assisting!!!
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:22
Joined
May 7, 2009
Messages
19,233
You are welcome maam.
 

Users who are viewing this thread

Top Bottom