Important alert: (current site time 7/15/2013 7:15:06 PM EDT)
 

VB icon

Code to get the last day of the given month!

Email
Submitted on: 6/20/2001 10:29:35 AM
By: Narayana Vyas Kondreddi  
Level: Advanced
User Rating: By 2 Users
Compatibility: SQL Server 7.0
Views: 15119
author picture
(About the author)
 
     To get the last day of the given month! UPDATED VERSION OF THIS CODE CAN BE FOUND AT: http://vyaskn.tripod.com/code.htm
 
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
--**************************************
-- for :Code to get the last day of the given month!
--**************************************
Copyright © 2001 Narayana Vyas Kondreddi. All rights reserved.
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
--**************************************
-- Name: Code to get the last day of the given month!
-- Description:To get the last day of the given month! 
UPDATED VERSION OF THIS CODE CAN BE FOUND AT: http://vyaskn.tripod.com/code.htm
-- By: Narayana Vyas Kondreddi
--
-- Assumes:I'm using GETDATE() in my query to get the current date. If you want to use the SQL statement against another date, please replace GETDATE() with that date.
--
--This code is copyrighted and has-- limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=312&lngWId=5--for details.--**************************************

SELECT DAY(DATEADD(d, -DAY(GETDATE()),DATEADD(m,1,GETDATE())))


Other 7 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
10/4/2006 2:24:10 AMNaru-chan

im just a student having problems with the water billing program and im using mySQL-Front and myODBC. I often encountered errors regarding my date fields. Im working with VB 6.0 and mySQL-Front. Im using the DTPicker control for getting the billing period like (PeriodFrom and PeriodTo). The prob is that if i check the table in the database the column for the fields PeriodFrom and PeriodTo do not contain the data i saved. Im using an adodc control with its connection via DSN=myODBC and commandtype to cmdText.The other fields are saved in the table except for the date fields. pls. guide me. i really need help on this. thank you.
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.