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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The usual English Date Format

Status
Not open for further replies.

paulcarey

Programmer
Jun 15, 2001
45
GB
I have a function:

Function EnglishDate(dDate)
y = year(dDate)
m = month(dDate)
d = day(dDate)
EnglishDate = d & "/" & m & "/" & y
End Function

If I feed it a date ie (#03/06/02#) then it returns 06/03/02 as I want.
However if I feed it variants obtained from an SQL call (sqlDate="SELECT sDate FROM tblEventDates WHERE DATCEN=1 AND DATCYR=" & year &" AND DATWKY = "& week &"")
it displays nothing.

for each x in rs.Fields
Response.Write(&quot;<td width = 110 bgcolor = cyan><b>&quot; & EnglishDate(x.value) & &quot;</b></td>&quot;)

The data is coming from an access database where the field in question is specified as a shortdate.

What am I missing? By deduction I would make the assumption that the data is not a date literal in which case how can I make it so?

Paul
 
What does the DATCEN, DATCYR and DATWKY -columns contain?!

Also: try adding
Code:
response.write sqlDate
somewhere in your code, it's often pretty obvious what the problem is, once you see what your database is fed... This is not a bug - it's an undocumented feature...
;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top