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

Formatting Time using .ASP wizard and Webbots 1

Status
Not open for further replies.

bigtwig

IS-IT--Management
Oct 20, 2002
18
0
0
US
Hi, I'm using FP 2000 with MS Access. I used the FP wizard to generate an .ASP page from the Access database and it works great, except the time is formated in HH:MM:SS xM format. Can I change this? Everytime I try to do something and change it, then save it, I get a message that it will revert to the previous changes when I save and it goes back to the Webbot generated page.

Thanks,
Mike
 
This is probably a bit late. You need to change it in the commented out bits. That tells the webbot what to do.
 
Thanks xwb,
Can you enlighten me? Do you need a snippet of code? When I make changes, the webbot seems to overright everything.
Thanks,
Mike
 
Modify the blue bits: not the red bits
Code:
      <!--webbot bot="DatabaseResultColumn" s-columnnames="CustomerID,CompanyName,ContactName,ContactTitle,Address,City,Region,PostalCode,Country,Phone,Fax" s-column="CustomerID" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview=[COLOR=BLUE]"&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;CustomerID&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"[/COLOR] startspan -->[COLOR=RED]<%=FP_FieldVal(fp_rs,"CustomerID")%>[/COLOR]<!--webbot bot="DatabaseResultColumn" endspan i-checksum="23468" --></td>
 
How can you change the time format from HH:MM:SS to HH:MM?
 
Can you post the commented out bits for the SQL and what you did to try to change it.
 
Don't worry about the code: here is a simpler way of doing it. For the field you wish to modify

1) Remove webbot code but keep the asp stuff. For instance, if your field is called "when", you'll be left with
Code:
<td><%=FP_FieldVal(fp_rs,"when")%></td>
2) If you want to display HH:MM:SS as HH:MM, change the field to
Code:
<td><%=left(FP_FieldVal(fp_rs,"when"), 5)%></td>
The value returned is a string, even though it was a time in the DB. Just take the leftmost 5 chars and you'll get HH:MM.

Hope this helps.
 
Close. With 12:00:00, it displays "12:00" - but with "2:00:00", you guessed it, "2:00:"
Thanks,
Mike
 
Try
Code:
<td><%=left(FP_FieldVal(fp_rs,"when"), instr(4,FP_FieldVal(fp_rs,"when"), ":", 1) - 1)%></td>
Looks a bit messy as it is executing FP_FieldVal twice. The alternative is to put it in a variable and then just use that. I haven't got IIS as work so I can't try it out to see whether it works or not. Something like
Code:
<td><%
fval = FP_FieldVal(fp_rs, "when")
=left(fval, instr(4, fval, ":", 1) - 1) %></td>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top