[thelist] SQL/Access

Daniel S. O'Shea doshea at surfree.com
Mon May 14 21:51:37 CDT 2001


I'm moving from Frontpage to SQL and still working locally on my machine.
After importing an Excel file into Access, the SQL query return from the
access database is giving me the full string on the date/time fields.
Example: 9/9/2001 for date and for time, 1:00:00 PM.
Is there a way I can get just 9/9 returned and 1:00 PM? I tried to change it
in Access but no matter how I change the field properties, I still get the
full string.

Everything else works great, would just like to get rid of the year and the
'seconds'.

Dan O.

Here is part of my code:


sql = "SELECT nflsched.week, " & _
      "nflsched.date, " & _
      "nflsched.team, " & _
      "nflsched.site, " & _
      "nflsched.opponent, " & _
      "nflsched.time, " & _
      "nflsched.day " & _
"FROM nflsched " & _
"WHERE nflsched.site='at' AND nflsched.week='Week 01' " & _
"ORDER BY nflsched.week, nflsched.date, nflsched.time;"

Set rsSched = Server.CreateObject("ADODB.Recordset")
rsSched.Open sql, cnn1, adOpenStatic, adLockReadOnly, adCmdText

varweek = rsSched("week").value
%>
</HEAD>
<BODY>
....html code....

  <td width=120 bgcolor="#F2F2F2"><SPAN
class="tabl"><%=Server.HTMLEncode(rsSched.Fields("day").Value)%>,&nbsp

<%=Server.HTMLEncode(rsSched.Fields("date").Value)%></SPAN></td>
  <td width=80 bgcolor="#F2F2F2"><SPAN
class="tabl"><%=Server.HTMLEncode(rsSched.Fields("team").Value)%></SPAN></td
>
  <td width=20 bgcolor="#F2F2F2"><SPAN
class="tabl"><center><%=Server.HTMLEncode(rsSched.Fields("site").Value)%></c
enter></SPAN></td>
  <td width=90 bgcolor="#F2F2F2"><SPAN
class="tabl"><%=Server.HTMLEncode(rsSched.Fields("opponent").Value)%></SPAN>
</td>
  <td width=70 bgcolor="#F2F2F2" align="center"><SPAN
class="tabl"><%=Server.HTMLEncode(rsSched.Fields("time").Value)%></SPAN></td
>
</tr>





More information about the thelist mailing list