We help IT Professionals succeed at work.

FrontPage and a database report

belch
belch asked
on
I am using the Insert\database\results to send an Access report to a web page.

In the access report a field is formatted as hh:nn:ss, but in the web page there is no format.

How do I set the format to hh:nn:ss on the web page?
Comment
Watch Question

ummmmm.....not really familiar with Access Reports, but tell me what it does and I'll see if there is something similar for the HTML/ASP coding.

Wait:  do you mean hh:mm:ss??

As in Hours, minutes, seconds for a time format???

Author

Commented:
It is time format. I am trying to format the SumOfExpr1 'variable'.

Here is the ASP code:

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>KPA</title>
</head>

<body background="bckgd.jpg">

<table width="100%" border="1">
  <thead>
    <tr>
      <td><b>KPA</b></td>
      <td><b>CountOfKPA</b></td>
      <td><b>SumOfExpr1</b></td>
    </tr>
  </thead>
  <tbody>
    <!--webbot bot="DatabaseRegionStart" startspan
    s-columnnames="KPA,CountOfKPA,SumOfExpr1" s-columntypes="202,3,5"
    s-dataconnection="db2" b-tableformat="TRUE" b-menuformat="FALSE"
    s-menuchoice s-menuvalue b-tableborder="TRUE" b-tableexpand="TRUE"
    b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE"
    i-ListFormat="0" b-makeform="TRUE" s-recordsource="Time2"
    s-displaycolumns="KPA,CountOfKPA,SumOfExpr1" s-criteria s-order
    s-sql="SELECT * FROM Time2" b-procedure="FALSE" clientside
    SuggestedExt="asp" s-DefaultFields s-NoRecordsFound="No records returned."
    i-MaxRecords="256" i-GroupSize="0" BOTID="0" u-dblib="_fpclass/fpdblib.inc"
    u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc"
    tag="TBODY"
    local_preview="&lt;tr&gt;&lt;td colspan=64 bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot; width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;Database Results regions will not preview unless this page is fetched from a Web server with a web browser. The following table row will repeat once for every record returned by the query.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;"
    preview="<tr><td colspan=64 bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot; width=&quot;100%&quot;><font color=&quot;#000000&quot;>This is the start of a Database Results region.</font></td></tr>" --><!--#include file="_fpclass/fpdblib.inc"-->
<%
fp_sQry="SELECT * FROM Time2"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=3 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="db2"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=3
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" i-CheckSum="48401" endspan -->
    <tr>
      <td><!--webbot bot="DatabaseResultColumn" startspan
        s-columnnames="KPA,CountOfKPA,SumOfExpr1" s-column="KPA"
        b-tableformat="TRUE" b-hasHTML="FALSE" clientside
        local_preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;KPA&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
        preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;KPA&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" --><%=FP_FieldVal(fp_rs,"KPA")%><!--webbot
        bot="DatabaseResultColumn" i-CheckSum="65302" endspan -->
      </td>
      <td><!--webbot bot="DatabaseResultColumn" startspan
        s-columnnames="KPA,CountOfKPA,SumOfExpr1" s-column="CountOfKPA"
        b-tableformat="TRUE" b-hasHTML="FALSE" clientside
        local_preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;CountOfKPA&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
        preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;CountOfKPA&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" --><%=FP_FieldVal(fp_rs,"CountOfKPA")%><!--webbot
        bot="DatabaseResultColumn" i-CheckSum="21302" endspan -->
      </td>
      <td><!--webbot bot="DatabaseResultColumn" startspan
        s-columnnames="KPA,CountOfKPA,SumOfExpr1" s-column="SumOfExpr1"
        b-tableformat="TRUE" b-hasHTML="FALSE" clientside
        local_preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;SumOfExpr1&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
        preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;SumOfExpr1&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" --><%=FP_FieldVal(fp_rs,"SumOfExpr1")%><!--webbot
        bot="DatabaseResultColumn" i-CheckSum="24488" endspan -->
      </td>
    </tr>
    <!--webbot bot="DatabaseRegionEnd" startspan b-tableformat="TRUE"
    b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0"
    clientside tag="TBODY"
    local_preview="&lt;tr&gt;&lt;td colspan=64 bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot; width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the end of a Database Results region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;"
    preview="&lt;tr&gt;&lt;td colspan=64 bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot; width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the end of a Database Results region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;" --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" i-CheckSum="62730" endspan -->
  </tbody>
</table>

</body>

</html>


Yuck...I hate the code FP spits out for this stuff.  Ok, let's see if I can figure it out....

Try this:

formatdatetime(SumofExpr1,vbShortTime)????


Don't know if that is what you are trying to pull....but that is how you specify a time format with ASP

Author

Commented:
where do i put this?

Author

Commented:
Where do i put that code????
Wherever you want the variable to appear in that format.

Author

Commented:
i have been putting it everywhere i can think of, but all i get are errors.

i want it in the SumOfExpr1 variable

i guess i dont know what i am doing...
Do you want it when it pulls the info from the db or puts it into it?

Author

Commented:
i am trying to do the webpage that pulls info from the database and displays it (The code above).
ok.

Teh problem is, again you are going to be messign with a "web-bot" we might have to rewrite the page with proper ASP instead of relying on FP's defaults.

Try this:

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>KPA</title>
</head>

<body background="bckgd.jpg">

<table width="100%" border="1">
 <thead>
   <tr>
     <td><b>KPA</b></td>
     <td><b>CountOfKPA</b></td>
     <td><b>SumOfExpr1</b></td>
   </tr>
 </thead>
 <tbody>
   <!--webbot bot="DatabaseRegionStart" startspan
   s-columnnames="KPA,CountOfKPA,SumOfExpr1" s-columntypes="202,3,5"
   s-dataconnection="db2" b-tableformat="TRUE" b-menuformat="FALSE"
   s-menuchoice s-menuvalue b-tableborder="TRUE" b-tableexpand="TRUE"
   b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE"
   i-ListFormat="0" b-makeform="TRUE" s-recordsource="Time2"
   s-displaycolumns="KPA,CountOfKPA,SumOfExpr1" s-criteria s-order
   s-sql="SELECT * FROM Time2" b-procedure="FALSE" clientside
   SuggestedExt="asp" s-DefaultFields s-NoRecordsFound="No records returned."
   i-MaxRecords="256" i-GroupSize="0" BOTID="0" u-dblib="_fpclass/fpdblib.inc"
   u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc"
   tag="TBODY"
   local_preview="&lt;tr&gt;&lt;td colspan=64 bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot; width=&quot;100%&quot;&gt;&lt;font
color=&quot;#000000&quot;&gt;Database Results regions will not preview unless this page is fetched from
a Web server with a web browser. The following table row will repeat once for every record returned
by the query.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;"
   preview="<tr><td colspan=64 bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot; width=&quot;100%&quot;><font
color=&quot;#000000&quot;>This is the start of a Database Results region.</font></td></tr>" --><!--#include
file="_fpclass/fpdblib.inc"-->
<%
fp_sQry="SELECT * FROM Time2"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=3 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="db2"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=3
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" i-CheckSum="48401" endspan -->
   <tr>
     <td><!--webbot bot="DatabaseResultColumn" startspan
       s-columnnames="KPA,CountOfKPA,SumOfExpr1" s-column="KPA"
       b-tableformat="TRUE" b-hasHTML="FALSE" clientside
       local_preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;KPA&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
       preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;KPA&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
--><%=FP_FieldVal(fp_rs,"KPA")%><!--webbot
       bot="DatabaseResultColumn" i-CheckSum="65302" endspan -->
     </td>
     <td><!--webbot bot="DatabaseResultColumn" startspan
       s-columnnames="KPA,CountOfKPA,SumOfExpr1" s-column="CountOfKPA"
       b-tableformat="TRUE" b-hasHTML="FALSE" clientside
       local_preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;CountOfKPA&lt;font
size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
       preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;CountOfKPA&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
--><%=FP_FieldVal(fp_rs,"CountOfKPA")%><!--webbot
       bot="DatabaseResultColumn" i-CheckSum="21302" endspan -->
     </td>
     <td><!--webbot bot="DatabaseResultColumn" startspan
       s-columnnames="KPA,CountOfKPA,SumOfExpr1" s-column="SumOfExpr1"
       b-tableformat="TRUE" b-hasHTML="FALSE" clientside
       local_preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;SumOfExpr1&lt;font
size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
       preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;SumOfExpr1&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
--><%=formatdatetime(fp_rs("SumofExpr1"),vbShortTime)%><!--webbot
       bot="DatabaseResultColumn" i-CheckSum="24488" endspan -->
     </td>
   </tr>
   <!--webbot bot="DatabaseRegionEnd" startspan b-tableformat="TRUE"
   b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0"
   clientside tag="TBODY"
   local_preview="&lt;tr&gt;&lt;td colspan=64 bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot; width=&quot;100%&quot;&gt;&lt;font
color=&quot;#000000&quot;&gt;This is the end of a Database Results region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;"
   preview="&lt;tr&gt;&lt;td colspan=64 bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot; width=&quot;100%&quot;&gt;&lt;font
color=&quot;#000000&quot;&gt;This is the end of a Database Results region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;"
--><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" i-CheckSum="62730" endspan -->
 </tbody>
</table>

</body>

</html>

Author

Commented:
Once again - your a lifesaver...
Glad it worked...surprised, and glad!  ;-)

Explore More ContentExplore courses, solutions, and other research materials related to this topic.