J
Jan Paul van de Berg
How do I handle date methods like getDate() on values I get from a
recordset? Example:
rs.Source= "Select SomeDateField From SomeTable"
....
1)
Response.write(rs.Fields.Item("SomeDateField"));
output: 11/16/2006
2)
Response.write(String(rs.Fields.Item("SomeDateField")));
output: Thu Nov 16 00:00:00 EST 2006
Since there's a difference I would expect rs.Fields.Item("SomeDateField")
is a date type. But I cannot apply date methods:
3)
Response.write((rs.Fields.Item("SomeDateField").Value).getDate());
error: 'rs.Fields.Item(...).Value' is null or not an object
4)
Response.write((rs.Fields.Item("SomeDateField")).getDate());
error: Object doesn't support this property or method
5)
Response.write(CDate(rs.Fields.Item("SomeDateField")).getDate());
error: Object expected
recordset? Example:
rs.Source= "Select SomeDateField From SomeTable"
....
1)
Response.write(rs.Fields.Item("SomeDateField"));
output: 11/16/2006
2)
Response.write(String(rs.Fields.Item("SomeDateField")));
output: Thu Nov 16 00:00:00 EST 2006
Since there's a difference I would expect rs.Fields.Item("SomeDateField")
is a date type. But I cannot apply date methods:
3)
Response.write((rs.Fields.Item("SomeDateField").Value).getDate());
error: 'rs.Fields.Item(...).Value' is null or not an object
4)
Response.write((rs.Fields.Item("SomeDateField")).getDate());
error: Object doesn't support this property or method
5)
Response.write(CDate(rs.Fields.Item("SomeDateField")).getDate());
error: Object expected