By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,816 Members | 2,151 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,816 IT Pros & Developers. It's quick & easy.

which function is used to count the days of selected month in vb 6.0?

dnb
P: 34
which function is used to count the days of the month which is selected from calendar in vb 6.0?

if i select "2/jan/2008" from calendar in this case days are "31" then how can i display number of days of different selected month selected month in to text box.
is there any function for that?
thanx in advance.....
Jan 9 '08 #1
Share this Question
Share on Google+
2 Replies


QVeen72
Expert 100+
P: 1,445
Hi,

Say your date is in variable MyDate (02-Jan-2008)

Expand|Select|Wrap|Line Numbers
  1. Dim TDate As Date
  2. TDate = DateSerial(Year(MyDate), Month(MyDate),1)
  3. MsgBox "Days Are : " & DateDiff("d",TDate,DateAdd("m",1,TDate))
  4.  
  5.  
Regards
Veena
Jan 9 '08 #2

P: 12
Hi,

Say your date is in variable MyDate (02-Jan-2008)

Expand|Select|Wrap|Line Numbers
  1. Dim TDate As Date
  2. TDate = DateSerial(Year(MyDate), Month(MyDate),1)
  3. MsgBox "Days Are : " & DateDiff("d",TDate,DateAdd("m",1,TDate))
  4.  
  5.  
Regards
Veena

Thanx QVeen72
It works......
Jan 9 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.