navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Adding multiable records by date range

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Adding multiable records by date range
Page: [1]
 
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.

(in reply to nguthier)
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.

(in reply to nguthier)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Adding multiable records by date range
Page: [1]
Jump to: 1





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