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  

=Format(Date(), "mm yy") does not display monthly data?



 
 
Thread Tools Display Modes
  #1  
Old December 14th, 2005, 09:17 AM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default =Format(Date(), "mm yy") does not display monthly data?

I am trying to get my query to compile our current monthly pass rates.
The above Criteria does help in displaying pass rates on an associated
report, but they are not the current month.
What is wrong with my Criteria?
  #2  
Old December 14th, 2005, 09:35 AM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default =Format(Date(), "mm yy") does not display monthly data?

Dear Paul:

The Format() function creates a text value. To use this text value to order
or to compare rows is probably not what you intend.

For example, which is greater:

12 05
1 06

When the above are compared as text, 12 05 is definitely the greater. Not
so when they are compared as dates! 2 comes after "space." And if you
have:

12 05
01 06

then 2 comes after 1, so as text, 12 05 still comes AFTER 01 06. When you
make this a text value, the order of values is all screwed up.

Perhaps what you mean is:

Year(Date2) Year(Date1) OR (Year(Date2) = Year(Date1) AND Month(Date2) =
Month(Date1))

Something like this probably would do what I'm pretty sure you intend. It
says that, if the NUMERIC value of the Year component is greater, then the
date is greater. If they're the same, then compare the NUMERIC month
values. If that is greater, or equal, then the test is TRUE. Otherwise,
it's FALSE.

A way to actually make it work correctly as a text comparison is to put the
MORE SIGNIFICANT year value first, along with making sure the values show 2
digits. In this comparison:

05 12
06 01

the comparison would always function correctly.

Not an uncommon difficulty. We've seen people who expect Jan to come before
Feb as well. Our brains KNOW to compare the months they represent. The
computer will only use the alphabetic order to make the comparison. Another
version of the same "human blindspot" syndrome. We're intelligent,
computers can be idiotically literal. That's all they're designed to be
able to do. Very little associative capacity, and no intuition.

Tom Ellison


"Paul Casavant" Paul wrote in message
...
I am trying to get my query to compile our current monthly pass rates.
The above Criteria does help in displaying pass rates on an associated
report, but they are not the current month.
What is wrong with my Criteria?



  #3  
Old December 14th, 2005, 10:59 AM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default =Format(Date(), "mm yy") does not display monthly data?

I have the above criteria in a "Pass Rate to Date" type query.
In the "Date" field of the query, I have the "Where" in the Total block
followed by =Format(Date(), "mm yy") in the Criteria block.
The current result is when anyone opens our QA database, it displays the
current pass rates for each section, it's just not accurate according to just
the 1-14 Dec data. The goal is to get the query to calculate all pass rates
from the first of the current month.
Will swapping the "mm yy" to "yy mm" work?

"Tom Ellison" wrote:

Dear Paul:

The Format() function creates a text value. To use this text value to order
or to compare rows is probably not what you intend.

For example, which is greater:

12 05
1 06

When the above are compared as text, 12 05 is definitely the greater. Not
so when they are compared as dates! 2 comes after "space." And if you
have:

12 05
01 06

then 2 comes after 1, so as text, 12 05 still comes AFTER 01 06. When you
make this a text value, the order of values is all screwed up.

Perhaps what you mean is:

Year(Date2) Year(Date1) OR (Year(Date2) = Year(Date1) AND Month(Date2) =
Month(Date1))

Something like this probably would do what I'm pretty sure you intend. It
says that, if the NUMERIC value of the Year component is greater, then the
date is greater. If they're the same, then compare the NUMERIC month
values. If that is greater, or equal, then the test is TRUE. Otherwise,
it's FALSE.

A way to actually make it work correctly as a text comparison is to put the
MORE SIGNIFICANT year value first, along with making sure the values show 2
digits. In this comparison:

05 12
06 01

the comparison would always function correctly.

Not an uncommon difficulty. We've seen people who expect Jan to come before
Feb as well. Our brains KNOW to compare the months they represent. The
computer will only use the alphabetic order to make the comparison. Another
version of the same "human blindspot" syndrome. We're intelligent,
computers can be idiotically literal. That's all they're designed to be
able to do. Very little associative capacity, and no intuition.

Tom Ellison


"Paul Casavant" Paul wrote in message
...
I am trying to get my query to compile our current monthly pass rates.
The above Criteria does help in displaying pass rates on an associated
report, but they are not the current month.
What is wrong with my Criteria?




  #4  
Old December 14th, 2005, 11:11 AM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default =Format(Date(), "mm yy") does not display monthly data?

I did swap the "mm yy" to "yy mm" and it didn't match the monthly data.
BUT, I changed it to "yyyy mm" and it WORKS!!
Will this change work when we go into 2006?

"Tom Ellison" wrote:

Dear Paul:

The Format() function creates a text value. To use this text value to order
or to compare rows is probably not what you intend.

For example, which is greater:

12 05
1 06

When the above are compared as text, 12 05 is definitely the greater. Not
so when they are compared as dates! 2 comes after "space." And if you
have:

12 05
01 06

then 2 comes after 1, so as text, 12 05 still comes AFTER 01 06. When you
make this a text value, the order of values is all screwed up.

Perhaps what you mean is:

Year(Date2) Year(Date1) OR (Year(Date2) = Year(Date1) AND Month(Date2) =
Month(Date1))

Something like this probably would do what I'm pretty sure you intend. It
says that, if the NUMERIC value of the Year component is greater, then the
date is greater. If they're the same, then compare the NUMERIC month
values. If that is greater, or equal, then the test is TRUE. Otherwise,
it's FALSE.

A way to actually make it work correctly as a text comparison is to put the
MORE SIGNIFICANT year value first, along with making sure the values show 2
digits. In this comparison:

05 12
06 01

the comparison would always function correctly.

Not an uncommon difficulty. We've seen people who expect Jan to come before
Feb as well. Our brains KNOW to compare the months they represent. The
computer will only use the alphabetic order to make the comparison. Another
version of the same "human blindspot" syndrome. We're intelligent,
computers can be idiotically literal. That's all they're designed to be
able to do. Very little associative capacity, and no intuition.

Tom Ellison


"Paul Casavant" Paul wrote in message
...
I am trying to get my query to compile our current monthly pass rates.
The above Criteria does help in displaying pass rates on an associated
report, but they are not the current month.
What is wrong with my Criteria?




 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
PST file has reached maximum size Jeff C General Discussion 2 October 6th, 2005 01:35 PM
Help PLEASE! Not sure what answer is: Match? Index? Other? baz Worksheet Functions 7 September 3rd, 2005 03:47 PM
Format on data to import to Access tables? (I need your advice) Niklas Östergren General Discussion 5 December 13th, 2004 02:54 PM
Upload Image Jason MacKenzie General Discussion 1 September 1st, 2004 04:38 AM
SQL view of messed up action queries Kendra Running & Setting Up Queries 2 August 31st, 2004 09:53 PM


All times are GMT +1. The time now is 03:07 PM.


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