473,804 Members | 3,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

dnb
34 New Member
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 1938
QVeen72
1,445 Recognized Expert Top Contributor
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 New Member
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
1896
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 the function. And of course time zones, yada yada .... BUT I think that most people using this will just want to say if today is there bday than they are their new age.
5
6693
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 Access. I have a database where they customer wants to purge records from certain tables after three years. When I was asked to make the changes I originally thought this was an incredibly simple thing to do. I looked at the function list and...
26
2733
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 to convert a latitude coord back to an accurate date time. Then I could detect the day/hour in the viewport when the timeline is zoomed in or out, or if it is moved. I cannot use the javascript date functions because this timeline will...
8
3945
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 (STARTDATE, ENDDATE DATE) RETURNS INTEGER DETERMINISTIC NO EXTERNAL ACTION BEGIN ATOMIC DECLARE DAYCOUNT INTEGER
2
1651
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 then give you the invoices for the selected month. 2) The first is adding the number of outstanding invoices in the report footer in the Invoice. I use this text box = IIf(Min()<Date()-30,"Please Pay Up","") to calcualte if the invoice had been...
3
9854
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 txns_per_crd_mnth from cdwdba.VW_DCM_EB_DLY_ALL_TRN_MSR where tran_dt between '2007-08-01' and '2007-10-31'
4
6453
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 got a good idea?
7
3226
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 should see 4 business days and 2 weekend days. How can I get that result? I'm getting 4 business days but its not counting the weekend days?
1
3809
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 varchar(16),name varchar(255),InDate datetime table C
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10578
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10321
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7620
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.