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

 

Need Help with looping

 
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 >> Need Help with looping
Page: [1]
 
dupati1

 

Posts: 84
Joined: 10/6/2003
Status: offline

 
Need Help with looping - 6/10/2004 9:29:09   
Hi Guys...

I am using ASP and SQL server 2000. Here is the scenario..

I have a form on the ASP page which adds all the details of the new equipment to the database. This is an easy job but what i have to do is add this equipment some 'n' number of times depending on the user selection of the frequency type.

If the user selects the frequency type on the form as 'MONTHLY'...first i have to get the present week number and then add this equipment to this week number and add it after every other 4 weeks. Something like below:

--- If present week is 4 then have to add this equipment for every 4 weeks since the frequency selected is MONTHLY

EquipID|weeknum
_______________
120| 4
120|8
120|12
... so on

120|52


If the user selects the frequency type as 'QUARTERLY' then i have to add the equipment for this week's number and for every 12 weeks( or 3 months).....

My frequency criteria are MONTHLY, QUARTERLY,SEMI-ANNUAL, ANNUAL...

I can get the present week number from
(DateDiff(wk,'1/1/2004',GetDate()))

so i need to loop based on the user selection in the frequency criteria.. keeping in mind that we have 52 weeks in total. I started writing the loop but got stuck wondering if the present week is 52 how do i go about reducing it back to 1 and the add the equipment accordingly..

Any suggestions...

-VJ
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Need Help with looping
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