PC Review


Reply
Thread Tools Rate Thread

Date Variable

 
 
Ranjith Kurian
Guest
Posts: n/a
 
      26th Mar 2009
Hi

I have one problem with the below code, it showing me the march 9th date,
how will i change it to 1st of every month, so that next month when i run
this it should show me 1st of April.

curmt = Format(Date, "mmm-yy")
curmth = CDbl(CDate(curmt))
MsgBox curmth

Answer is 39881, the required answer is 39873


 
Reply With Quote
 
 
 
 
Franz E
Guest
Posts: n/a
 
      26th Mar 2009
Hi, use this code instead:

curmt = Format(Date, "mmm-yyyy")
curmth = CDbl(CDate(curmt))
MsgBox curmth


"Ranjith Kurian" wrote:

> Hi
>
> I have one problem with the below code, it showing me the march 9th date,
> how will i change it to 1st of every month, so that next month when i run
> this it should show me 1st of April.
>
> curmt = Format(Date, "mmm-yy")
> curmth = CDbl(CDate(curmt))
> MsgBox curmth
>
> Answer is 39881, the required answer is 39873
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open file with variable date name based on current date Ciprian Microsoft Excel Programming 1 7th Jan 2010 02:31 PM
assigning a null value of a date field to a date variable George Microsoft Access Form Coding 4 3rd May 2008 11:50 AM
calc constant date from variable date & return with ability to rn. =?Utf-8?B?U3VzaWVRJ3NRdWVzdA==?= Microsoft Excel Worksheet Functions 1 9th Nov 2004 08:51 PM
Compare Date in Cell VS a Variable Date to Hide Row =?Utf-8?B?SmltSQ==?= Microsoft Excel Programming 3 10th Oct 2004 04:26 PM
Is there a function to get only the date from a full date and time variable Fred Palmer Microsoft Access Queries 2 16th Sep 2003 02:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:48 AM.