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  

MAX function is not picking right date in ms access



 
 
Thread Tools Display Modes
  #1  
Old February 23rd, 2010, 08:07 AM posted to microsoft.public.access.queries
Eluruking
external usenet poster
 
Posts: 1
Default MAX function is not picking right date in ms access

Hi Access Gurus,

Can you please help on the following issue.

We are facing difficulty to find out latest date of each customer. We used
MAX functionality, surprisingly this has given a wrong result. Can you
please assist us to get the desired value. Your fastest reply would really
appreciated. .





Here is the details of the issue

Table: Customer

Format: Text for all fields

Date format in the source table: DD.MM.YYYY

Customers: 301000016, 301000043

Reference
DocumentNo
Doc Date
Net due dt
Customer

GLE-0801
100024068
31.03.2008
07.04.2008
301000016


100024353
07.04.2008
07.04.2008
301000016

ANZBWAUD 08044
1400000301
07.04.2008
07.04.2008
301000016


1200001298
13.03.2009
13.03.2009
301000043


1200011327
13.03.2009
13.03.2009
301000043

CLR OLD PROV
1200012025
01.06.2009
01.06.2009
301000043


1200020506
19.03.2009
19.03.2009
301000043




Following is the result of the query with Max functionality

MaxOfDoc Date
Customer

31.03.2008
301000016

19.03.2009
301000043




The result what we are expecting is:

301000016-07.04.2008

301000043-01.06.2009



Thanks in advance,

Regards,

Eluru
  #2  
Old February 23rd, 2010, 09:02 AM posted to microsoft.public.access.queries
Allen Browne
external usenet poster
 
Posts: 11,706
Default MAX function is not picking right date in ms access

Your mistake was to use a TEXT field to store your dates.
Access then sorts/evaluates the field as text.

To solve your problem (plus many others you will have), use a Date/Time
field instead.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Eluruking" wrote in message
...
Hi Access Gurus,

Can you please help on the following issue.

We are facing difficulty to find out latest date of each customer. We used
MAX functionality, surprisingly this has given a wrong result. Can you
please assist us to get the desired value. Your fastest reply would really
appreciated. .





Here is the details of the issue

Table: Customer

Format: Text for all fields

Date format in the source table: DD.MM.YYYY

Customers: 301000016, 301000043

Reference
DocumentNo
Doc Date
Net due dt
Customer

GLE-0801
100024068
31.03.2008
07.04.2008
301000016


100024353
07.04.2008
07.04.2008
301000016

ANZBWAUD 08044
1400000301
07.04.2008
07.04.2008
301000016


1200001298
13.03.2009
13.03.2009
301000043


1200011327
13.03.2009
13.03.2009
301000043

CLR OLD PROV
1200012025
01.06.2009
01.06.2009
301000043


1200020506
19.03.2009
19.03.2009
301000043




Following is the result of the query with Max functionality

MaxOfDoc Date
Customer

31.03.2008
301000016

19.03.2009
301000043




The result what we are expecting is:

301000016-07.04.2008

301000043-01.06.2009



Thanks in advance,

Regards,

Eluru


 




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 10:37 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.