Query for repeating

digit

Registered User.
Local time
Today, 07:04
Joined
Jan 23, 2003
Messages
44
Dear Friends,
is there someone who can tell deside my problem.
I have the table with columns:
ID, Date, Days, Total
251 25.01.2004 5 254.68 $
Where Days 5 is how many days i was have the same sum.

How can i make an inquiry :
ID, Date, Days, Total
251 25.01.2004 1 50,94 $
251 25.01.2004 1 50,94 $
251 25.01.2004 1 50,94 $
251 25.01.2004 1 50,94 $
251 25.01.2004 1 50,94 $
Many thanks
 
You mean:
You have a table with one record (5 days) and you want now to see 5 records seperate for each of them days?

Only way you can do that is by creating a Union query
Code:
select id,date, 1 as NoDays, total/days as TotalPerDay from your table where days >= 1
Union select id,date, 1 as NoDays, total/days as TotalPerDay from your table where days >= 2
Union select id,date, 1 as NoDays, total/days as TotalPerDay from your table where days >= 3
etc...

Hope that helps.

Regardz
 
You actually need to do this in VBA with DAO or ADO. I don't believe a query will work. The union query suggestion would require that you know before you code the query, the maximum number of days because the union would need a select for each day.
 

Users who are viewing this thread

Back
Top Bottom