473,419 Members | 2,499 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,419 software developers and data experts.

displaying date by counting on days

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...
Nov 25 '07 #1
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?
Nov 26 '07 #2
lotus18
866 512MB
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.
Nov 26 '07 #3
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.......
Nov 26 '07 #4
Killer42
8,435 Expert 8TB
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).
Nov 26 '07 #5
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.......
Nov 26 '07 #6
Mohan Krishna
115 100+
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
Expand|Select|Wrap|Line Numbers
  1. Combo1.AddItem (Format(DateAdd("d", -1, DateSerial(Year(Now), Month(Now) + 1, 1)), "dd-mm-yyyy"))
  2. Combo1.AddItem (Format(DateAdd("d", 14, DateSerial(Year(Now), Month(Now) + 1, 1)), "dd-mm-yyyy"))
  3. Combo1.AddItem (Format(DateAdd("d", 30, DateSerial(Year(Now), Month(Now), Day(Now))), "dd-mm-yyyy"))
  4.  
I used Format(), and if you don't need uou can remove.

ALL THE BEST!
Nov 26 '07 #7
Killer42
8,435 Expert 8TB
Thanks for the examples, Mohan. Just one thing - I think the final one is much longer than necessary.

Expand|Select|Wrap|Line Numbers
  1. Combo1.AddItem (Format(DateAdd("d", 30, DateSerial(Year(Now), Month(Now), Day(Now))), "dd-mm-yyyy"))
  2. ' This could easily be coded as...
  3. Combo1.AddItem (Format(DateAdd("d", 30, Now), "dd-mm-yyyy"))
  4.  
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.
Nov 26 '07 #8
Mohan Krishna
115 100+
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!
Nov 26 '07 #9
To Mr. Mohan and Mr. Killer,
thank you so much for the examples...
it really helps...
=)
Nov 26 '07 #10
Killer42
8,435 Expert 8TB
To Mr. Mohan and Mr. Killer,
thank you so much for the examples...
it really helps...
=)
Glad we could help. :)
Nov 27 '07 #11
Mohan Krishna
115 100+
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!
Nov 27 '07 #12

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

Similar topics

5
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...
36
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?
29
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...
7
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...
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
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,...
1
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,...
0
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...

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.