|
| |
|
|
nguthier
Posts: 3 Joined: 8/13/2008 Status: offline
|
Adding multiable records by date range - 8/13/2008 15:08:41
I have a form that people can add info based on a date. What I need to do is let them select a date range and add a record for each date in the range. If anybody got a suggestions It would help a lot. Thanks
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Adding multiable records by date range - 8/15/2008 9:32:59
Are you comfortable with straight ASP? If so, I see some sort of loop for the days using the DateDiff function. Something like this perhaps? <% 'open your DB - myDSN would be your connection string set conntemp=server.createobject("adodb.connection") conntemp.open myDSN 'find out how many days to do it and set a loop For i = 0 to DateDiff("d",FirstDate,SecondDate) 'build the SQL mySQL = "INSERT INTO myEventTable (DateField,EventTextField) VALUES (#" & DateAdd("d", i,FirstDate) & "#,'" & YourEventTextVariable & "')" 'run the SQL conntemp.execute(ddSQL) next conntemp.close set conntemp=nothing %> See what I'm doing? I'm creating a loop for however many days between FirstDate and SecondDate. Then I create an SQL statement each time and add "i" days to FirstDate each time through. That make any sense?
< Message edited by rdouglass -- 8/15/2008 10:04:44 >
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
nguthier
Posts: 3 Joined: 8/13/2008 Status: offline
|
RE: Adding multiable records by date range - 8/15/2008 9:37:21
Thank you very much. I got it working.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|