Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type mismatch

Status
Not open for further replies.

JeroenDortmans

Technical User
Aug 7, 2001
56
NL
I have a Access database which has a table with a field "Tijdstempel". This field is a "date / time" field. When this filed isn't empty this code works fine.

<%
Tijdstempel_connector = FP_FieldVal(fp_rs,&quot;Tijdstempel&quot;)
Tijdstempel_connector2 = Day(Tijdstempel_connector) & &quot;/&quot; & Month(Tijdstempel_connector) & &quot;/&quot; & Year(Tijdstempel_connector)
%>
<% Response.Write &quot;Last modified: &quot; + Tijdstempel_connector2 %>

When this field is empty I get the error message Type mismatch: 'Tijdstempel_connector'.
How can I solve this.
 
use an if statement to check if the filed is greater than &quot;&quot; The secret of life is honesty and fair dealing. If you can fake that, you've got it made.
Groucho Marx (1895-1977)
 
Same resolt when I use this code:

<%
Tijdstempel_connector = FP_FieldVal(fp_rs,&quot;Tijdstempel&quot;)
If Tijdstempel_connector > &quot;&quot; Then
Tijdstempel_connector2 = Day(Tijdstempel_connector) & &quot;/&quot; & Month(Tijdstempel_connector) & &quot;/&quot; & Year(Tijdstempel_connector)
End If
%>
 
Shouldn't it be ...

If Tijdstempel_connector <> &quot;&quot; Then

instead of

If Tijdstempel_connector > &quot;&quot; Then

Ladyhawk. [idea]
** ASP/VB/Java Programmer **
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top