Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Increment 15 mins until value reached

Status
Not open for further replies.

Taff82

Programmer
Feb 11, 2004
43
0
0
GB
Hi All,

Not sure if this is possible but here goes.

I have a form with a time in the format "hh:nn". What I would like to do is create a query that takes the value from my form and adds a row for each 15 minute increment until it reaches a certain time i.e. 16:30.

So if the time on my form is 14:00 the query would display:-

14:15
14:30
14:45
and so on.

Thanks for any help on this.

Taff.
 
Jet SQL does not have loops.
I think you would need to do this in a VBA procedure.

You would need to be adding a record to a table for each time value you need.

 
Thanks lupins46 for your suggestion.

Not sure how to do that but I will have a look into it.

Regards,

Taff.
 
Another way is to create a table with all the times, say tblAllTime:[tt]
dtTime
------
00:00
00:15
...
23:30
23:45[/tt]
And now your query:
SELECT dtTime FROM tblAllTime
WHERE dtTime Between [Forms]![your mainform]![your time control] And #16:30#;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top