Re: Scroll through records and get match

Tech-Archive recommends: Speed Up your PC by fixing your registry



The query's SQL statement to do this would be

SELECT Animal FROM Tbl_Table
WHERE W_C_Date = Date();

Not sure under which scenarios you want to loop through the data? Can you
explain a bit more about your setup and what you want to do?

--

Ken Snell
<MS ACCESS MVP>

"Andrew" <Andrew@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0DF5517E-C204-4F15-A937-17F9C39DE37A@xxxxxxxxxxxxxxxx
Hi,

I have a table (Tbl_Table) in the following format:

W_C_Date Animal
02/07/06 Cat
09/07/06 Dog
16/07/06 Fox
etc
etc
etc

Can someone please provide me with the SQL to loop through and find the
Animal based on todays date. If todays date is 02/07/06 the answer is
Cat.
If todays date is 03/07/06 the answer is Cat. If todays date is 09/07/06
the
answer is Dog.

Thanks in advance





--
Andrew
040706


.



Relevant Pages

  • Re: Scroll through records and get match
    ... A RunSQL statemnt requires an argument consisting of an SQL statement. ... "Ken Snell " wrote: ... <MS ACCESS MVP> ... Animal based on todays date. ...
    (microsoft.public.access.modulesdaovba)
  • RE: vba loop statement
    ... How to open a recordset and loop through the records. ... off updating the records via a SQL Statement as in... ... you have a situation where the discounted price is fixed price less than the ...
    (microsoft.public.access.modulesdaovba)
  • RE: vba loop statement
    ... "David H" wrote: ... How to open a recordset and loop through the records. ... off updating the records via a SQL Statement as in... ... you have a situation where the discounted price is fixed price less than the ...
    (microsoft.public.access.modulesdaovba)
  • Re: How to execute query fast within multile loops
    ... SQL statement, mainly if your SQL statement can DO the loop itself, such as ... SELECT SUM, ProductID ... "How to execute query fast within multile" <How to execute query fast within ...
    (microsoft.public.access.queries)
  • Re: Age Analysis - SQL Help
    ... SQL statement will executed be in a loop for each customer. ... either 0 for a numeric or "" (empty string) for all other ...
    (comp.databases.ms-access)