If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > how to extract month from 2 value

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-19-03, 07:03
zakyk zakyk is offline
Registered User
 
Join Date: Mar 2003
Posts: 32
how to extract month from 2 value

hi,

i want to ask about this situation

how can i extract month value from 2 value selected ? it look like this

i have first combobox a (month) b(year) then i select JAN 2003 then
second combox c(month) d(year) then i select DEC 2003 and then i can input one value example like totalAmount = 10.00. After that stat from JAN2003 until DEC2003 will store the same value of totalAmount = 10.00

Jan 2003 | Feb 2003 | March 2003 | ...| Dec 2003
10.00 10.00 10.00 10.00

it's that possible asp code be done? can u tell me how
Reply With Quote
  #2 (permalink)  
Old 05-19-03, 10:45
MrWizard MrWizard is offline
Registered User
 
Join Date: Mar 2003
Location: Atlanta, GA
Posts: 191
confused....

I cannot figure out what it is you want to know.

It sounds like you are selecting a date from each of two combo boxes, and applying an entered value to all the months between the selected dates. Is that it?

If cDate1=the date from combo box1, and cDate2=the date from combo box2, then

Then
numMonths=DateDiff("m",cDate1,cDate2) returns the total number of months between cDate1 and cDate2.

You could then use this in a For-Next loop

For n=1 to numMonths
newdate=DateAdd("m",n,cDate1)
... do other stuff based on newdate.
Next 'n

The DateDiff and DateAdd functions are both standard VBScript functions. The "m" parameter in each specifys that you want to work with months rather than days, years, seconds or whatever else.

Hope this helps.

Tim
__________________
Tim
Reply With Quote
  #3 (permalink)  
Old 05-19-03, 21:25
zakyk zakyk is offline
Registered User
 
Join Date: Mar 2003
Posts: 32
Thumbs up

yes it's exactly what i want to do.. ist that the value m can return month value between selected combo box
Reply With Quote
  #4 (permalink)  
Old 05-19-03, 21:52
MrWizard MrWizard is offline
Registered User
 
Join Date: Mar 2003
Location: Atlanta, GA
Posts: 191
so...

So I don't know if you're asking another question.

I showed you how to do it in my last post.

Good Luck

Tim
__________________
Tim
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On