Queries & Date fields

  • Thread starter Andrew J. Berry
  • Start date
A

Andrew J. Berry

Hello all. I am doing a query on a table where my colum
has multiple dates. I am trying to have access "count"
the different days in the date field and give the result.
The problem is, for instance, "9-2-03" may be in the colum
3 times. Using the "count" in the queries criteria
adds "9-2-03" 3 times and outputs 3. I only want it to
show as 1 day no matter how many times it's in the colum.
Any suggestions?

Drew.
 
R

Rebecca Riordan

Drew,

Yeah, I suggest you fix your database schema. You should never, never,
ever, include more than one item of information in a column. And your
problem is a good example of why. Split the dates out to a separate table,
with one row per date and a one-to-many relationship between the existing
table and the new one. Your problem will simply disappear.

HTH

--
Rebecca Riordan, MVP

Designing Relational Database Systems
Microsoft SQL Server 2000 Programming Step by Step
Microsoft ADO.NET Step by Step

http://www.microsoft.com/mspress

Blessed are they who can laugh at themselves,
for they shall never cease to be amused...
 

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