try another color scheme:


Go Back   TECH6.0 > Get Techie > Programming > ASP/ASP.NET


Calculate total year and month

This is a discussion on Calculate total year and month within the ASP/ASP.NET section, part of the Programming category; hai there.... For total year and month calculation i am using this code..but it always giving me incorrect month... Please ...

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 27-02-2008, 12:17 PM
Spec_tray's Avatar

Moderator
 
Join Date: Feb 2008
Posts: 147
Spec_tray will become famous soon enoughSpec_tray will become famous soon enough
Default Calculate total year and month

hai there....


For total year and month calculation i am using this code..but it always

giving me incorrect month... Please lightup

Code:
Dim Strdifyears,Strdifmonth,ff

Strdifyears=DateDiff("yyyy",RS.fields("Frmdt"),Date)+(Date<DateSerial(Year(Date),Month(RS.fields("Frmdt")),Day(RS.fields("Frmdt"))))
ff=ff+(Date<DateSerial(Year(Date),Month(RS.fields("Frmdt")),Day(Rs.fields("Frmdt"))))

If Cint(ff)<0 then
 Strdifmonth=12-Cint(Month(Rs.fields("From_dt")))
End If
Thnaks in advance
Reply With Quote
Reply

Bookmarks


Thread Tools
Display Modes




All times are GMT +5.5. The time now is 01:02 AM.

Contact Us - Tech6.com - Link to Us - Advertise - Submit Site - Privacy Statement - TOS - Top