L lumbanico Member Aug 5, 2013 #1 Does anyone know why the following function gives a different value depending on whether returns int or string? Code: Copy Sub fncMakeId () As Int 'if string returns a different value Dim datFecha As Long DateTime.DateFormat = "yyyyMMdd" DateTime.TimeFormat = "hhmmssSSS" datFecha = DateTime.Now Return DateTime.Date(datFecha) & DateTime.Time(datFecha) End Sub Thanks.
Does anyone know why the following function gives a different value depending on whether returns int or string? Code: Copy Sub fncMakeId () As Int 'if string returns a different value Dim datFecha As Long DateTime.DateFormat = "yyyyMMdd" DateTime.TimeFormat = "hhmmssSSS" datFecha = DateTime.Now Return DateTime.Date(datFecha) & DateTime.Time(datFecha) End Sub Thanks.
klaus Expert Licensed User Longtime User Aug 5, 2013 #2 It would be easier to answer you if you told us what exactly you want to do ! A date and time is stored in a Long type variable, this you get with DateTime.Now, Long is a long Integer ! So what do you expect with Return DateTime.Date(datFecha) & DateTime.Time(datFecha) ? Knowing that DateTime.Date(datFecha) returns a String ! Best regards. Upvote 0
It would be easier to answer you if you told us what exactly you want to do ! A date and time is stored in a Long type variable, this you get with DateTime.Now, Long is a long Integer ! So what do you expect with Return DateTime.Date(datFecha) & DateTime.Time(datFecha) ? Knowing that DateTime.Date(datFecha) returns a String ! Best regards.