Wrox Programmer Forums
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 18th, 2004, 05:28 AM
Authorized User
 
Join Date: Apr 2004
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to know ?

First fogiver me about my poor english !
 What I want is How to kown For example If customer chose January I know it has 31 days If customer chose February I know it has 28 days
and so on......
Thank for your help .

 
Old June 21st, 2004, 12:03 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

If you want to know the last day of the previous month, you use something like this: DateSerial(2004, 3, 0)

In this case, you get the date 29 February 2004

If you use this: DateSerial(2004, 9, 0)

you get 31 August 2004. Try it.



Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old June 21st, 2004, 12:18 PM
Authorized User
 
Join Date: Jun 2003
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can also check out this Website: http://mvps.org/access/datetime/date0007.htm

This gives great examples that help when you do not want to limit the code to just the previous month. This is from an Access point of view but the code works in VB as well.

Kenny Alligood









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.