Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: retriving records between years


Message #1 by topwebdesigns@h... on Thu, 30 May 2002 05:29:15
I have a question about this in my table 98-02 as in years for 
automobiles is there a way to search for products if my customers ask for 
say 99
Any help would be great
Thanks in advance
Message #2 by "Wesley Kendrick" <wez.k@n...> on Thu, 30 May 2002 06:39:37 +0100
Hi

Select your year, for instance by typing it into a text box on a form, or
using a listbox, then create a query that uses the selection as its filter
criteria on the year field.

Regards, Wesley Kendrick

----- Original Message -----
From: <topwebdesigns@h...>
To: "Access" <access@p...>
Sent: Thursday, May 30, 2002 5:29 AM
Subject: [access] retriving records between years


> I have a question about this in my table 98-02 as in years for
> automobiles is there a way to search for products if my customers ask for
> say 99
> Any help would be great
> Thanks in advance
>

Message #3 by topwebdesigns@h... on Thu, 30 May 2002 15:16:12
> Hi

Select your year, for instance by typing it into a text box on a form, or
using a listbox, then create a query that uses the selection as its filter
criteria on the year field.

Regards, Wesley Kendrick

----- Original Message -----
From: <topwebdesigns@h...>
To: "Access" <access@p...>
Sent: Thursday, May 30, 2002 5:29 AM
Subject: [access] retriving records between years


> I have a question about this in my table 98-02 as in years for
> automobiles is there a way to search for products if my customers ask 
for
> say 99
> Any help would be great
> Thanks in advance

in my record the year field data is in this format"98-02" not whole years 
and seperaed by dash is there a way to use that data as it stands or do i 
have to break down into beging year and end year fields
Message #4 by "Gregory Serrano" <SerranoG@m...> on Thu, 30 May 2002 16:51:42
<< in my record the year field data is in this format"98-02" not whole 
years and seperaed by dash is there a way to use that data as it stands or 
do i have to break down into beging year and end year fields >>

Your best bet is to separate the start and end years and merely do a 
comparison to see if the chosen year falls between them.  Make sure the 
years are four digits.

For this particular case, i.e. your field is a string "98-02", then you'd 
have to write VB code pulling out the beginning year Left(string,2) and 
the end year Right(string,2).

Then you'd have to look at the year and decide what year is the cut-off 
point for 1900s vs. 2000s.  Say, for example, that you know that models 
start at 1910.  If you read that the end year is "02" then you'd have to 
tell the computer that end year is really 2000 + 02 or 2002.  If you have 
end year is "56" then you'd have to tell the computer that end year is 
really 56 + 1900 or 1956.

Greg

  Return to Index