zachvaldez
asked on
Date displaying 12:00 AM when null
Date displaying 12:00 AM when null and not "N/A"
If IsDate(RsCatalogInfo!RowLa
g_CatalogInfo(g_iCatPoint)
Else
g_CatalogInfo(g_iCatPoint)
End If
Two comments, hope helps.
You are reading a datetime value out of SQL database? Null datetime appears as something like '1800-01-01 12:00:00'. Instead of IsDate test for this value (check value, I'm recalling from memory) and make sure it is never used as an actual date elswhere.
And I don't know reason for fds_fatboy style suggestion but if you follow it you will lose some intellisense.
You are reading a datetime value out of SQL database? Null datetime appears as something like '1800-01-01 12:00:00'. Instead of IsDate test for this value (check value, I'm recalling from memory) and make sure it is never used as an actual date elswhere.
And I don't know reason for fds_fatboy style suggestion but if you follow it you will lose some intellisense.
It sounds like yiu are hoding zeroes on the database instead of nulls.
The style thing should not lose you any intellisense because using bang notation - as it is late bound - as is dot notation.
The bang notation is a VB anomaly which is shorthand for the dot notation. In VBA it is less efficient to use bang notation because the interpreterwill convert it to dot notation before interpreting that. Bang notation in VB involves using the Default Collection/Property. The concept of Default Properties has caused problems since VB went object based. Anyway, it's probably my problem - not yours.
It is purely a style thing and I wouldn't lose any sleep over it.
The style thing should not lose you any intellisense because using bang notation - as it is late bound - as is dot notation.
The bang notation is a VB anomaly which is shorthand for the dot notation. In VBA it is less efficient to use bang notation because the interpreterwill convert it to dot notation before interpreting that. Bang notation in VB involves using the Default Collection/Property. The concept of Default Properties has caused problems since VB went object based. Anyway, it's probably my problem - not yours.
It is purely a style thing and I wouldn't lose any sleep over it.
If NZ(RsCatalogInfo!RowLastUp dtDtTi,"") <> "" Then
Alan
Alan
ASKER
Is NZ available in VB6? or access olnly
Hi Zac,
Its available in vb6 too, belongs the Visual Basic Library and is exposed in Access by setting a reference to Visual Basic for Applications (VBA)
Alan
Its available in vb6 too, belongs the Visual Basic Library and is exposed in Access by setting a reference to Visual Basic for Applications (VBA)
Alan
ASKER
Member not found is the error message for NZ
Hi Zac,
Heres one I use with vbscript in ASP, because NZ function is not supported in Vbscript
Public Function hNz(vValue, vValueIfNull)
If IsNull(vValue) Then
If IsNull(vValueIfNull) Then
hNz = ""
Else
hNz = vValueIfNull
End If
Else
hNz = vValue
End If
End Function
Heres one I use with vbscript in ASP, because NZ function is not supported in Vbscript
Public Function hNz(vValue, vValueIfNull)
If IsNull(vValue) Then
If IsNull(vValueIfNull) Then
hNz = ""
Else
hNz = vValueIfNull
End If
Else
hNz = vValue
End If
End Function
ASKER
A function added to the string in the array??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
PS: As a matter of style, RsCatalogInfo!RowLastUpdtD