Hey all,
I have been using a date format with LCID and a format code I was shown by this forum a while back which works fine when there is a date in the field.
The problem I had was when the date field was Null, I would get an error. So I tried and if then Else statement which is where I was still tearing my hair out until I just swapped the code around and reversed the argument.
Can anybody tell me why this code DOES Work:
And this code DOES NOT work
It is the same argument, but just asking the opposite question of the date field.
Thoughts?
Cheers
Dean
-------------------------------------------------------------
"The most overlooked advantage of owning a computer is that if they foul up there's no law against whacking them around a bit."
I have been using a date format with LCID and a format code I was shown by this forum a while back which works fine when there is a date in the field.
The problem I had was when the date field was Null, I would get an error. So I tried and if then Else statement which is where I was still tearing my hair out until I just swapped the code around and reversed the argument.
Can anybody tell me why this code DOES Work:
Code:
<%
Dim Mymonth
Mymonth = (Men.Fields.Item("DatePaid").Value)
%>
<%
If Mymonth <>"" Then
Response.Write Day(Mymonth)&"-"&MonthName(Month(Mymonth),true)&"-"&Right(Year(Mymonth),2)
Else
response.Write("Not Paid")
End If
%>
Code:
<%
Dim Mymonth
Mymonth = (Men.Fields.Item("DatePaid").Value)
%>
<%
If Mymonth = "" Then
response.Write("Not Paid")
Else
Response.Write Day(Mymonth)&"-"&MonthName(Month(Mymonth),true)&"-"&Right(Year(Mymonth),2)
End If
%>
It is the same argument, but just asking the opposite question of the date field.
Thoughts?
Cheers
Dean
-------------------------------------------------------------
"The most overlooked advantage of owning a computer is that if they foul up there's no law against whacking them around a bit."