[mso] Re: Access: Converting Date To Year For Parameter Look Ups

Cathy--

The date/time format on the date field (as seen in table design view)
only affects the presentation of the date; the actual date is stored in
the database as a number, regardless of format. So that's not the
problem. If you're returning '1905', have you checked your record to be
*sure* you don't have that date inadvertently stored in one or more
rows? To check, you can run a query like the following:

SELECT DISTINCT ClassCompleted
FROM tblClassInformation
WHERE ClassCompleted < #12/31/2001#;

I'm interested to hear what shows up...

--Jim

-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On
Behalf Of Cathy.Evans@xxxxxxxxx
Sent: Tuesday, February 24, 2004 9:22 AM
To: mso@xxxxxxxxxxxxx
Subject: [mso] Re: Access: Converting Date To Year For Parameter Look
Ups



Making progress . . . this returns 4 rows of 1905 as the year.  I have
dates ranging from 2001 to 2004, so I am looking for only 4 rows
returned, but how is it returning 1905? I've got the field in the table
as date/time, medium format, I don't want it formatted as year on the
main table.  Is that causing a problem?  Thank you again, Cathy



 

                      "Jim Pettit"

                      <j_e_pettit@hotmail      To: <mso@xxxxxxxxxxxxx>

                      .com>

                      Sent by:                 cc:

                      mso-bounce@freelist

                      s.org                    Subject:  [mso] Re:
Access: Converting Date To Year For 
                      02/24/2004 11:18 AM         Parameter Look Ups

                      Please respond to

                      mso
.... 
 

 





Cathy--

If I understand you correctly, you're trying to use the Format function
n the date field to populate the drop down. If so, you should be using
the DatePart function as follows:

SELECT DISTINCT DatePart("yyyy",[ClassCompleted]) AS [Year] FROM
tblClassInformation GROUP BY DatePart("yyyy",[ClassCompleted]) HAVING
(((DatePart("yyyy",[ClassCompleted])) Is Not Null)) ORDER BY
DatePart("yyyy",[ClassCompleted]);

Hope this helps...

--Jim

-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On
Behalf Of Cathy.Evans@xxxxxxxxx
Sent: Tuesday, February 24, 2004 8:10 AM
To: mso@xxxxxxxxxxxxx
Subject: [mso] Re: Access: Converting Date To Year For Parameter Look
Ups



Jim, here is the SQL for the query.  The date field is formatted as
yyyy. Hope this helps, thanks.

SELECT DISTINCT tblClassInformation.ClassCompleted AS [Year] FROM
tblClassInformation GROUP BY tblClassInformation.ClassCompleted
HAVING (((tblClassInformation.ClassCompleted) Is Not Null)) ORDER BY
tblClassInformation.ClassCompleted;





------------------------------------------------------------------------
-----------------------------
The information transmitted is intended only for the person
or entity to which it is addressed and may contain confidential and/or
privileged material. If you are not the intended recipient 
of this message you are hereby notified that any use, review,
retransmission, dissemination, distribution, reproduction or any action
taken in reliance upon this message is prohibited. If you 
received this in error, please contact the sender and delete the 
material from any computer.  Any views expressed in this message are
those of the individual sender and may not necessarily reflect 
the views of the company.  
------------------------------------------------------------------------
-------------------------------

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx
or MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the
quotes) in the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will
also allow you to change your email settings to digest or vacation (no
mail). http://www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group,
send a request to mso-moderators@xxxxxxxxxxxxx and you will be sent an
invitation with instructions.  Once you are a member of the files group,
you can go here to upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in 
the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will also allow 
you to change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

Other related posts: