![]() |
| cfloop dates and then use in a query |
|
windsorben
|
Can anyone show me what the code would look like for looping through two weeks of dates and then using those dates as a WHERE statement in a query. In other words, I want to retrieve the results of a query that match the date of the cfloop.
Thanks! |
||||||||||||
|
|
|||||||||||||
|
bobclingan
Forum Regular
|
Dates are natively supported by the cfloop tag already.
|
||||||||||||||
|
|
|||||||||||||||
| How do I write the select WHERE statement |
|
windsorben
|
Thanks for your help. Now, how do I write the WHERE statement?
WHERE Date = <cfoutput>#i#</cfoutput> And, if so, will it run through all the dates? This is my first time at using a loop. Thanks for your help. |
||||||||||||
|
|
|||||||||||||
|
bobclingan
Forum Regular
|
That's correct.
SELECT foo FROM bar WHERE theDate = #i# |
||||||||||||
|
|
|||||||||||||
| thank you |
|
windsorben
|
I'll give it a shot! Appreciate you taking time out to help a beginner.
|
||||||||||||
|
|
|||||||||||||
|
palyne
|
I just wanted to thank Bob Clingan whose simple code clip, by accident, solved a problem I've had for six months with making an assignments rota app. Thanks man!!
|
||||||||||||
|
|
|||||||||||||
|
bobclingan
Forum Regular
|
Glad I could be of service
|
||||||||||||
|
|
|||||||||||||
| cfloop dates and then use in a query |
|
||
|


