hey there all..
i have a several questions about how to displaying date by counting on days..
i get the current date, and how to display date for:
1. end of this month
2. the 15th of next month
3. 30days from the current date
thank u guyz...
11 1676
im using combo box for the list and a textbox to display the date by the way,
does anyone know how the coding is?
im using combo box for the list and a textbox to display the date by the way,
does anyone know how the coding is?
Use the AddDate function and Now.
Use the AddDate function and Now.
but for what i need is this: to display the date of:
1. the end of this month
2. the 15th of next month
3. 30days from the current date im using combobox for the list of that 3 kinds days,
and as for the display of the date, im using textbox..
do u know how?
thankz alot.......
You haven't said what version of VB you're using. But in VB6, the DateSerial() function is very useful for this sort of thing. I'd recommend you check it out. It allows you to easily generate a date using constant values, variables, or calculations/offsets (such as today + 30, for example).
You haven't said what version of VB you're using. But in VB6, the DateSerial() function is very useful for this sort of thing. I'd recommend you check it out. It allows you to easily generate a date using constant values, variables, or calculations/offsets (such as today + 30, for example).
yeah im using VB6..
do you have the example how to use this function?
such as to display the date of the end of the month?
thanks in advance.......
yeah im using VB6..
do you have the example how to use this function?
such as to display the date of the end of the month?
thanks in advance.......
Hi
This may help you... if I got you right -
Combo1.AddItem (Format(DateAdd("d", -1, DateSerial(Year(Now), Month(Now) + 1, 1)), "dd-mm-yyyy"))
-
Combo1.AddItem (Format(DateAdd("d", 14, DateSerial(Year(Now), Month(Now) + 1, 1)), "dd-mm-yyyy"))
-
Combo1.AddItem (Format(DateAdd("d", 30, DateSerial(Year(Now), Month(Now), Day(Now))), "dd-mm-yyyy"))
-
I used Format(), and if you don't need uou can remove.
ALL THE BEST!
Thanks for the examples, Mohan. Just one thing - I think the final one is much longer than necessary. -
Combo1.AddItem (Format(DateAdd("d", 30, DateSerial(Year(Now), Month(Now), Day(Now))), "dd-mm-yyyy"))
-
' This could easily be coded as...
-
Combo1.AddItem (Format(DateAdd("d", 30, Now), "dd-mm-yyyy"))
-
Also, it might be better to use a named format such as "Short date" or "Medium date" rather than "dd-mm-yyyy" because diferent people (and countries) prefer different formats.
Thanks for the examples, Mohan. Just one thing - I think the final one is much longer than necessary.
:
:
Also, it might be better to use a named format such as "Short date" or "Medium date" rather than "dd-mm-yyyy" because diferent people (and countries) prefer different formats.
Than Q Killer!
I wrote in the flow. Sorry and Thanks!
To Mr. Mohan and Mr. Killer,
thank you so much for the examples...
it really helps...
=)
To Mr. Mohan and Mr. Killer,
thank you so much for the examples...
it really helps...
=)
Glad we could help. :)
To Mr. Mohan and Mr. Killer,
thank you so much for the examples...
it really helps...
=)
Hi
To my knowledge, I could help and ALL THE VERY BEST!
Sign in to post your reply or Sign up for a free account.
Similar topics
by: BlackFireNova |
last post by:
I need to write a report in which one part shows a count of how many
total records fall within the working days (Monday - Friday) inside of a
(prompted) given date range, in a particular...
|
by: MLH |
last post by:
Does
Date = Date + 1
mean
Date Statement equals Date Function plus 1?
And if the answer is Yes, how much actual time
is being added to the date function in this assignment?
|
by: james |
last post by:
I have a problem that at first glance seems not that hard to figure out. But, so far, the answer has escaped me. I have an old
database file that has the date(s) stored in it as number of days.
An...
|
by: No bother |
last post by:
I have a table which has, among other fields, a date field. I want to
get a count of records where certain criteria are met for, say, three
days in a row. For example:
NumWidgets Date...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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...
|
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...
|
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: 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...
| |