Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Next Month Calculation

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-22-07, 11:08
mustish1 mustish1 is offline
Registered User
 
Join Date: Jul 2006
Posts: 145
Next Month Calculation

Hi: Can any one please tell me how to i calculate the next month starting day and next month ending date. For example if this is january then i need the next month that is february starting day and february ending day. I need to calculate the date in that way given below, I mean without query. Below method is i use it to calculate the todays date and the end of the day.

MonthLastDay = Empty
dFirstDayNextMonth = DateSerial(CInt(Format(dCurrDate, "yyyy")), CInt(Format(dCurrDate, "mm")) + 1, 1)
MonthLastDay = DateAdd("d", -1, dFirstDayNextMonth)

Thanks,
Reply With Quote
  #2 (permalink)  
Old 01-22-07, 11:27
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 13,551
that's gonna fail in december
__________________
r937.com | rudy.ca

pre-order my book Simply SQL from Amazon
Reply With Quote
  #3 (permalink)  
Old 01-22-07, 15:24
pbaldy pbaldy is online now
Registered User
 
Join Date: May 2005
Location: Nevada, USA
Posts: 1,137
__________________
Paul
Reply With Quote
  #4 (permalink)  
Old 01-22-07, 15:52
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 13,551
my bad :blush:

i underestimated microsoft access again!

DateSerial(2006,13,1) does indeed generate 2007-01-01

sorry
__________________
r937.com | rudy.ca

pre-order my book Simply SQL from Amazon
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

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