473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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

dnb
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
2 1903
QVeen72
1,445 Expert 1GB
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
hnpatel
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

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

Similar topics

3
by: Brynn | last post by:
Here is a function where you don't have to worry about the leap year. You will have to still be aware of time differences between you and the server, and correct your data before entering it into...
5
by: mcbill20 | last post by:
Hello all. I have a really basic question that I hope someone has a better answer for. I apologize in advance-- I know this is probably a really basic question but I am used to Oracle rathern than...
26
by: jshanman | last post by:
I am writing a timeline that uses Google Maps. I have a function that converts a date time to latitude coords. This function is used to draw the markers on the timeline. I need a reverse function...
8
by: Ian Mackenzie | last post by:
Hi Guys I am VERY new to DB2 and have created a workingdays function to return the working days between 2 dates, but I get some compiler errors when running it: CREATE FUNCTION WORKINGDAYS...
2
by: yellowarmy | last post by:
Theres two problems i have. 1) Theres a question i have to answer in a mock is that the company does invoices every month but i need it for to select invoice and then select the month whcih would...
3
by: paulvonhippel | last post by:
I'd like to count the number of transactions for each debit card and month over a 3-month period. But this query -- select DBT_CRD_DIM_NB, month (tran_dt) as tran_mnth, count(*) as...
4
by: JAW | last post by:
I need to get the first day of the previous month in a query. I thought CURRENT DATE and DAYOFMONTH would allow me to da it but it is noe WHERE DTXL >= 1st day of previous month Anyone...
7
by: Mike | last post by:
I have a routine that's calculating business days but its not counting the weekend days that are between the start date and end date. If my start date is 9/26/08 and my end date is 10/01/08, I...
1
by: kummu4help | last post by:
hi, i am using mysql. i have 3 tables with following structures. these are not actual tables i am working on. table A id varchar(16),name varchar(255),InDate datetime table B id...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.