Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 07:31 AM
Geoff Wickens
Guest
 
Posts: n/a
Default Date formats in webpages

I am new to using ASP and am trying to develop a site for the band I am a
member of. The data for our bookings is held in an Access database and I can
manipulate the date format as much as I like in Access but it doesn't make
any difference to what appears in my webpage.

The page is http://www.bedfordtownband.org.uk/calendar.asp

I want to get dates appearing as for example:

Sun 10 Aug 2003.

This is easy to achieve in Access and I have done so. However, I don't seem
to have any control over how the date appears in the asp page. To get the
day appearing which is important to me I have had to enter this as a field
in its own right, not really what I want to do. The code I use to produce
the calendar part of the page is as below:

<table width="100%" border="2" cellpadding="5">
<tr>
<td width="19%"><font size="1"><b>Date</b></font></td>
<td width="16%"><font size="1"><b>Band</b></font></td>
<td width="19%"><font size="1"><b>Venue</b></font></td>
<td width="16%"><font size="1"><b>Time</b></font></td>
<td width="30%"><font size="1"><b>Notes</b></font></td>
</tr>
<%
Set Catalog=Server.CreateObject("ADODB.Recordset")
Catalog.open "SELECT * FROM qrybookings", "DSN=calendar"
Do WHILE NOT Catalog.EOF
Response.Write "<tr valign='top'><td><font size='1'>" & Catalog("day") & " "
& Catalog("date") & "</font></td><td><font size='1'>" & Catalog("band") &
"</font></td><td><font size='1'>" & Catalog("venue") &
"</font></td><td><font size='1'>" & Catalog("time") & "</font></td><td><font
size='1'>" & Catalog("notes") & "</font></td></tr>"

Catalog.MoveNext
Loop
%>
</table>

I imagine there must be a way of doing this in ASP but I can't find it! If
anyone can help with this I would be very grateful indeed.

Geoff Wickens
Bedford Town Band


  #2  
Old July 19th, 2005, 07:31 AM
Alan
Guest
 
Posts: n/a
Default Re: Date formats in webpages

You have to format the date after you retrieve it. Look up the functions
WeekdayName() and FormatDateTime() in MSDN.

Regards,

Alan

"Geoff Wickens" <gwickens@ntlworld.com> wrote in message
news:Q2pZa.114$Ll.67372@newsfep1-win.server.ntli.net...[color=blue]
> I am new to using ASP and am trying to develop a site for the band I am a
> member of. The data for our bookings is held in an Access database and I[/color]
can[color=blue]
> manipulate the date format as much as I like in Access but it doesn't make
> any difference to what appears in my webpage.
>
> The page is http://www.bedfordtownband.org.uk/calendar.asp
>
> I want to get dates appearing as for example:
>
> Sun 10 Aug 2003.
>
> This is easy to achieve in Access and I have done so. However, I don't[/color]
seem[color=blue]
> to have any control over how the date appears in the asp page. To get the
> day appearing which is important to me I have had to enter this as a field
> in its own right, not really what I want to do. The code I use to produce
> the calendar part of the page is as below:
>
> <table width="100%" border="2" cellpadding="5">
> <tr>
> <td width="19%"><font size="1"><b>Date</b></font></td>
> <td width="16%"><font size="1"><b>Band</b></font></td>
> <td width="19%"><font size="1"><b>Venue</b></font></td>
> <td width="16%"><font size="1"><b>Time</b></font></td>
> <td width="30%"><font size="1"><b>Notes</b></font></td>
> </tr>
> <%
> Set Catalog=Server.CreateObject("ADODB.Recordset")
> Catalog.open "SELECT * FROM qrybookings", "DSN=calendar"
> Do WHILE NOT Catalog.EOF
> Response.Write "<tr valign='top'><td><font size='1'>" & Catalog("day") & "[/color]
"[color=blue]
> & Catalog("date") & "</font></td><td><font size='1'>" & Catalog("band") &
> "</font></td><td><font size='1'>" & Catalog("venue") &
> "</font></td><td><font size='1'>" & Catalog("time") &[/color]
"</font></td><td><font[color=blue]
> size='1'>" & Catalog("notes") & "</font></td></tr>"
>
> Catalog.MoveNext
> Loop
> %>
> </table>
>
> I imagine there must be a way of doing this in ASP but I can't find it![/color]
If[color=blue]
> anyone can help with this I would be very grateful indeed.
>
> Geoff Wickens
> Bedford Town Band
>
>[/color]


  #3  
Old July 19th, 2005, 07:31 AM
Alan
Guest
 
Posts: n/a
Default Re: Date formats in webpages

Here is a link to the MSDN library online:
http://msdn.microsoft.com/library/default.asp

Alan


"Alan" <SPAMMENOTalan.howard@inspire.net.nz> wrote in message
news:OtGosryXDHA.2448@TK2MSFTNGP09.phx.gbl...[color=blue]
> You have to format the date after you retrieve it. Look up the functions
> WeekdayName() and FormatDateTime() in MSDN.
>
> Regards,
>
> Alan
>
> "Geoff Wickens" <gwickens@ntlworld.com> wrote in message
> news:Q2pZa.114$Ll.67372@newsfep1-win.server.ntli.net...[color=green]
> > I am new to using ASP and am trying to develop a site for the band I am[/color][/color]
a[color=blue][color=green]
> > member of. The data for our bookings is held in an Access database and I[/color]
> can[color=green]
> > manipulate the date format as much as I like in Access but it doesn't[/color][/color]
make[color=blue][color=green]
> > any difference to what appears in my webpage.
> >
> > The page is http://www.bedfordtownband.org.uk/calendar.asp
> >
> > I want to get dates appearing as for example:
> >
> > Sun 10 Aug 2003.
> >
> > This is easy to achieve in Access and I have done so. However, I don't[/color]
> seem[color=green]
> > to have any control over how the date appears in the asp page. To get[/color][/color]
the[color=blue][color=green]
> > day appearing which is important to me I have had to enter this as a[/color][/color]
field[color=blue][color=green]
> > in its own right, not really what I want to do. The code I use to[/color][/color]
produce[color=blue][color=green]
> > the calendar part of the page is as below:
> >
> > <table width="100%" border="2" cellpadding="5">
> > <tr>
> > <td width="19%"><font size="1"><b>Date</b></font></td>
> > <td width="16%"><font size="1"><b>Band</b></font></td>
> > <td width="19%"><font size="1"><b>Venue</b></font></td>
> > <td width="16%"><font size="1"><b>Time</b></font></td>
> > <td width="30%"><font size="1"><b>Notes</b></font></td>
> > </tr>
> > <%
> > Set Catalog=Server.CreateObject("ADODB.Recordset")
> > Catalog.open "SELECT * FROM qrybookings", "DSN=calendar"
> > Do WHILE NOT Catalog.EOF
> > Response.Write "<tr valign='top'><td><font size='1'>" & Catalog("day") &[/color][/color]
"[color=blue]
> "[color=green]
> > & Catalog("date") & "</font></td><td><font size='1'>" & Catalog("band")[/color][/color]
&[color=blue][color=green]
> > "</font></td><td><font size='1'>" & Catalog("venue") &
> > "</font></td><td><font size='1'>" & Catalog("time") &[/color]
> "</font></td><td><font[color=green]
> > size='1'>" & Catalog("notes") & "</font></td></tr>"
> >
> > Catalog.MoveNext
> > Loop
> > %>
> > </table>
> >
> > I imagine there must be a way of doing this in ASP but I can't find it![/color]
> If[color=green]
> > anyone can help with this I would be very grateful indeed.
> >
> > Geoff Wickens
> > Bedford Town Band
> >
> >[/color]
>
>[/color]


  #4  
Old July 19th, 2005, 07:31 AM
Geoff Wickens
Guest
 
Posts: n/a
Default Re: Date formats in webpages

Many thanks for the great assistance. I have now got it working!

Geoff


"Alan" <SPAMMENOTalan.howard@inspire.net.nz> wrote in message
news:unx65syXDHA.2620@TK2MSFTNGP09.phx.gbl...[color=blue]
> Here is a link to the MSDN library online:
> http://msdn.microsoft.com/library/default.asp
>
> Alan
>
>
> "Alan" <SPAMMENOTalan.howard@inspire.net.nz> wrote in message
> news:OtGosryXDHA.2448@TK2MSFTNGP09.phx.gbl...[color=green]
> > You have to format the date after you retrieve it. Look up the functions
> > WeekdayName() and FormatDateTime() in MSDN.
> >
> > Regards,
> >
> > Alan
> >
> > "Geoff Wickens" <gwickens@ntlworld.com> wrote in message
> > news:Q2pZa.114$Ll.67372@newsfep1-win.server.ntli.net...[color=darkred]
> > > I am new to using ASP and am trying to develop a site for the band I[/color][/color][/color]
am[color=blue]
> a[color=green][color=darkred]
> > > member of. The data for our bookings is held in an Access database and[/color][/color][/color]
I[color=blue][color=green]
> > can[color=darkred]
> > > manipulate the date format as much as I like in Access but it doesn't[/color][/color]
> make[color=green][color=darkred]
> > > any difference to what appears in my webpage.
> > >
> > > The page is http://www.bedfordtownband.org.uk/calendar.asp
> > >
> > > I want to get dates appearing as for example:
> > >
> > > Sun 10 Aug 2003.
> > >
> > > This is easy to achieve in Access and I have done so. However, I don't[/color]
> > seem[color=darkred]
> > > to have any control over how the date appears in the asp page. To get[/color][/color]
> the[color=green][color=darkred]
> > > day appearing which is important to me I have had to enter this as a[/color][/color]
> field[color=green][color=darkred]
> > > in its own right, not really what I want to do. The code I use to[/color][/color]
> produce[color=green][color=darkred]
> > > the calendar part of the page is as below:
> > >
> > > <table width="100%" border="2" cellpadding="5">
> > > <tr>
> > > <td width="19%"><font size="1"><b>Date</b></font></td>
> > > <td width="16%"><font size="1"><b>Band</b></font></td>
> > > <td width="19%"><font size="1"><b>Venue</b></font></td>
> > > <td width="16%"><font size="1"><b>Time</b></font></td>
> > > <td width="30%"><font size="1"><b>Notes</b></font></td>
> > > </tr>
> > > <%
> > > Set Catalog=Server.CreateObject("ADODB.Recordset")
> > > Catalog.open "SELECT * FROM qrybookings", "DSN=calendar"
> > > Do WHILE NOT Catalog.EOF
> > > Response.Write "<tr valign='top'><td><font size='1'>" & Catalog("day")[/color][/color][/color]
&[color=blue]
> "[color=green]
> > "[color=darkred]
> > > & Catalog("date") & "</font></td><td><font size='1'>" &[/color][/color][/color]
Catalog("band")[color=blue]
> &[color=green][color=darkred]
> > > "</font></td><td><font size='1'>" & Catalog("venue") &
> > > "</font></td><td><font size='1'>" & Catalog("time") &[/color]
> > "</font></td><td><font[color=darkred]
> > > size='1'>" & Catalog("notes") & "</font></td></tr>"
> > >
> > > Catalog.MoveNext
> > > Loop
> > > %>
> > > </table>
> > >
> > > I imagine there must be a way of doing this in ASP but I can't find[/color][/color][/color]
it![color=blue][color=green]
> > If[color=darkred]
> > > anyone can help with this I would be very grateful indeed.
> > >
> > > Geoff Wickens
> > > Bedford Town Band
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles