Click here to Skip to main content
16,006,442 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Whats wrong? Pin
badcredit13-Mar-05 16:28
badcredit13-Mar-05 16:28 
GeneralSpan Between Dates Pin
Computer_Guy13-Mar-05 15:10
Computer_Guy13-Mar-05 15:10 
General<edit>Re: Span Between Dates <edit /> Pin
Edbert P13-Mar-05 18:02
Edbert P13-Mar-05 18:02 
GeneralRe: &lt;edit&gt;Re: Span Between Dates &lt;edit /&gt; Pin
Computer_Guy13-Mar-05 18:10
Computer_Guy13-Mar-05 18:10 
GeneralRe: <edit>Re: Span Between Dates <edit /> Pin
Edbert P13-Mar-05 19:35
Edbert P13-Mar-05 19:35 
GeneralRe: &lt;edit&gt;Re: Span Between Dates &lt;edit /&gt; Pin
Computer_Guy14-Mar-05 2:09
Computer_Guy14-Mar-05 2:09 
GeneralRe: &lt;edit&gt;Re: Span Between Dates &lt;edit /&gt; Pin
Edbert P14-Mar-05 11:25
Edbert P14-Mar-05 11:25 
GeneralRe: &lt;edit&gt;Re: Span Between Dates &lt;edit /&gt; Pin
Computer_Guy14-Mar-05 11:40
Computer_Guy14-Mar-05 11:40 
Thanks, Thought you might like a copy of the finised product...

Dim days As Date
Dim weeks As Date
Dim months As Date
Dim years As Date
Dim numofyears As Integer
Dim numofmonths As Integer
Dim numofdays As Integer
Dim numofweeks As Integer

Dim y As Long = DateDiff(DateInterval.Year, Convert.ToDateTime(dtArrival.Text), Convert.ToDateTime(dtDeparture.Text))

years = DateAdd(DateInterval.Year, y, Convert.ToDateTime(dtArrival.Text))

numofyears = DatePart(DateInterval.Year, years) - DatePart(DateInterval.Year, Convert.ToDateTime(dtArrival.Text))

lblYears.Text = numofyears.ToString

Dim m As Long = DateDiff(DateInterval.Month, Convert.ToDateTime(dtArrival.Text), Convert.ToDateTime(dtDeparture.Text))

months = DateAdd(DateInterval.Month, m, Convert.ToDateTime(dtArrival.Text))

numofmonths = DatePart(DateInterval.Month, months) - DatePart(DateInterval.Month, Convert.ToDateTime(dtArrival.Text))

lblMonths.Text = numofmonths.ToString


Dim d As Long = DateDiff(DateInterval.Day, Convert.ToDateTime(dtArrival.Text), Convert.ToDateTime(dtDeparture.Text))

days = DateAdd(DateInterval.Day, d, Convert.ToDateTime(dtArrival.Text))

numofdays = DatePart(DateInterval.Day, days) - DatePart(DateInterval.Day, Convert.ToDateTime(dtArrival.Text))

lblDays.Text = numofdays


RegardsBig Grin | :-D

"The things that will destroy us are: politics without principle; pleasure without conscience; wealth without work; knowledge without character; business without morality; science without humanity; and worship without sacrifice."
-Mahatma Gandhi (1869-1948)

GeneralRe: &lt;edit&gt;Re: Span Between Dates &lt;edit /&gt; Pin
Edbert P14-Mar-05 12:11
Edbert P14-Mar-05 12:11 
GeneralRe: &lt;edit&gt;Re: Span Between Dates &lt;edit /&gt; Pin
Computer_Guy14-Mar-05 12:46
Computer_Guy14-Mar-05 12:46 
GeneralCrystals Reports Pin
SamaniUmang13-Mar-05 9:40
SamaniUmang13-Mar-05 9:40 
General,Crystal Reports Pin
Anonymous13-Mar-05 9:35
Anonymous13-Mar-05 9:35 
GeneralUsing VB for Industrial Controls Pin
R Finch13-Mar-05 9:19
R Finch13-Mar-05 9:19 
GeneralPassword submission Pin
innova@13-Mar-05 6:31
innova@13-Mar-05 6:31 
Questionhow to work with sql connection Pin
pateldishant13-Mar-05 5:15
pateldishant13-Mar-05 5:15 
AnswerRe: how to work with sql connection Pin
Colin Angus Mackay13-Mar-05 6:01
Colin Angus Mackay13-Mar-05 6:01 
AnswerRe: how to work with sql connection Pin
J4amieC13-Mar-05 22:36
J4amieC13-Mar-05 22:36 
Questionhow to insert the data in data grid ? Pin
vidyashankar13-Mar-05 0:28
vidyashankar13-Mar-05 0:28 
AnswerRe: how to insert the data in data grid ? Pin
Jaydeanster13-Mar-05 19:50
Jaydeanster13-Mar-05 19:50 
GeneralPlease help me! ::cries:: Pin
Kc Martinez12-Mar-05 22:47
Kc Martinez12-Mar-05 22:47 
GeneralRe: Please help me! ::cries:: Pin
Dave Kreskowiak14-Mar-05 1:27
mveDave Kreskowiak14-Mar-05 1:27 
GeneralRe: Please help me! ::cries:: Pin
14-Mar-05 9:52
suss14-Mar-05 9:52 
Generalrestore mysql database in vb .net Pin
heeheelim12-Mar-05 22:16
sussheeheelim12-Mar-05 22:16 
GeneralRe: restore mysql database in vb .net Pin
Colin Angus Mackay13-Mar-05 3:41
Colin Angus Mackay13-Mar-05 3:41 
GeneralHide TabPage Pin
Mohamed Ishak12-Mar-05 22:06
professionalMohamed Ishak12-Mar-05 22:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.