filter table based on date

  • Thread starter Emanuel Violante
  • Start date
E

Emanuel Violante

Hello,

I have a table with multiple fields for each record , ID, YEAR, MONTH,
01,02...31 (days in a month)
ID YEAR MONTH 01 02

1 2009 05 20 15
2 2009 05 10 17
3 2009 05 11 02
4 2009 05 05 36

I woul like to build a query for the records of 02/05/2009
the output of the query should be:
ID YEAR MONTH 02

1 2009 05 15
2 2009 05 17
3 2009 05 02
4 2009 05 36

Any ideas???????
TKS

--
Thanks,

Sorry if my english isn''t correct, but I''m from Potugal ;)

Emanuel Violante Galeano
 
J

June7

With this structure must concatenate fields
Code
-------------------
SELECT ID, YEAR, MONTH, 02 FROM table WHERE month & '/' & year = '05/2009'
-------------------

The fields 01 and 02 are the first two days of month and you have 3
columns, one for each day of month and values entered are quantities
This does not appear to be appropriate database design and looks lik
inventory type data. You probably should have a table with fields like:

ID
DateEnter
Quantity

You don't mention other fields such as any that would be foreign key
that link data to other tables. Without knowing more about what you
data represents hard to advise on structure. I just know that to have 3
date columns doesn't seem to fit conventional database desig
principles
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top