navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

summing up sales

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> summing up sales
Page: [1]
 
Meni

 

Posts: 29
Joined: 8/3/2005
Status: offline

 
summing up sales - 11/26/2005 9:30:35   
After reading several of the posts here I still can't get this to work.

I have a table called Employees. this table has - Key, daySold, productName, priceSold, employeeName, soldTo.

the 'employeeName' is linked to another table called Employees. table employees has a field called employeeName and IT is the one that contains the real value.

I have an ASP page that enables the user to input a "new purchase" details.

I need a query that will show each employeeName and it's total Sales between daySold-X and daySold-Y.
daySold is a date field = dd/mm/yyyy

Thanks.
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: summing up sales - 11/26/2005 11:24:54   
In your post, you state that each table is named employees, I assume that is a typo on your part. Also, what database are you using? Will you be working in FrontPage or pure ASP?

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Meni)
Meni

 

Posts: 29
Joined: 8/3/2005
Status: offline

 
RE: summing up sales - 11/26/2005 16:14:01   
sorry... typo indeed. the first table i refered to is "Products"
the second is Employees.

Using Access DB with Frontpage DRW.


Thanks.

(in reply to BeTheBall)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: summing up sales - 11/26/2005 22:01:54   
Something like:

SELECT employeeName, Sum(priceSold) AS totalSales FROM Products WHERE daySold BETWEEN #::startDate::# AND #::endDate::# GROUP BY employeeName

assuming you query the db with a form that has two date fields, named startDate and endDate.

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Meni)
Meni

 

Posts: 29
Joined: 8/3/2005
Status: offline

 
RE: summing up sales - 11/27/2005 3:52:31   
If I use the query you wrote down - I get a page with a table that contains employeeName and totalSales, where the totalSales sums up EVERY sale ever made (i am ignoring the date filter for now) and the employeeName is 0.

I should emphesize that the "employeName" is derived from a different table - called Employees.

Any ideas?


(in reply to BeTheBall)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: summing up sales - 11/27/2005 15:14:51   
What field in the Products table identifies the employee?

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Meni)
Meni

 

Posts: 29
Joined: 8/3/2005
Status: offline

 
RE: summing up sales - 11/27/2005 15:16:19   
the field name is employeeName as well... but it's a lookup field. I don't know if that has a meaning...

(in reply to BeTheBall)
Meni

 

Posts: 29
Joined: 8/3/2005
Status: offline

 
RE: summing up sales - 11/29/2005 2:55:30   
so... no ideas? are you giving up on me? :)

(in reply to Meni)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: summing up sales - 11/29/2005 10:30:48   
When you say it is a lookup field, do you mean that what gets inserted into the products table is say the ID from the Employee table rather than the name?

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Meni)
Meni

 

Posts: 29
Joined: 8/3/2005
Status: offline

 
RE: summing up sales - 11/29/2005 10:59:55   
well yes.
i have a form for new sales. this form will create a new entry in Products database this form has several fields. one field is "employeeName", and one is "soldTo". the seller is a dropbox that contains all "employeeName" from a table called Employees.

i hope i am clear...
:)

(in reply to BeTheBall)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: summing up sales - 11/29/2005 11:11:29   
Yes and no. When you insert a record into Products, what gets inserted as the employeeName? Is it the actual name or a number that corresponds to the name. Guessing it's a number, but want to be sure.

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Meni)
yogaboy

 

Posts: 377
Joined: 5/22/2004
Status: offline

 
RE: summing up sales - 11/29/2005 14:31:30   
Have you tried adding the ProductName field in the groupby?

SELECT employeeName, Sum(priceSold) AS totalSales, ProductName
FROM Products WHERE daySold BETWEEN #::startDate::# AND #::endDate::#
GROUP BY employeeName, ProductName

I'm shamelessly using BeTheBall's code - We stand on the shoulders of giants!!:)

(in reply to BeTheBall)
Meni

 

Posts: 29
Joined: 8/3/2005
Status: offline

 
RE: summing up sales - 12/1/2005 13:14:07   
i don't really care about the product name. i just want to see the total $$ sales... besides - product name is a free text field where users can type anything they want. i don't have a product list fro them to choose from so i would imagine that there is HELL in that field and i would really like to disregard it.

HOWEVER -

I will try this query and I will tell you what it returns...

Thanks

(in reply to yogaboy)
yogaboy

 

Posts: 377
Joined: 5/22/2004
Status: offline

 
RE: summing up sales - 12/1/2005 13:32:37   
I'm just covering the bases, BeTheBall's first query should have worked fine.

(in reply to Meni)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: summing up sales - 12/1/2005 15:55:26   
What is your response to this:

http://www.frontpagewebmaster.com/fb.asp?m=301707

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Meni)
Meni

 

Posts: 29
Joined: 8/3/2005
Status: offline

 
RE: summing up sales - 12/2/2005 4:31:27   
BeTheBall =

<option VALUE="<%=FP_FieldHTML(fp_rs,"employeeName")%>" selected><%=FP_FieldHTML(fp_rs,"employeeName")%>

so i guess the employee name is inserted...

(in reply to BeTheBall)
Meni

 

Posts: 29
Joined: 8/3/2005
Status: offline

 
RE: summing up sales - 12/2/2005 5:04:44   
ok i think i understand the issue now.
the form that enters data into the DB inserts tha data in a way that will eventually enter the value "0" into the employeeName field in the Products table.

how do i solve this?



by the way - YogaBoy - your query actuall yreturns the values in different fields! so i guess this is a step forward...



(in reply to Meni)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: summing up sales - 12/2/2005 10:16:17   
Can you post the code for the page that inserts the record as well as the page you use to view the results?

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Meni)
Meni

 

Posts: 29
Joined: 8/3/2005
Status: offline

 
RE: summing up sales - 12/2/2005 12:54:33   
the form that enters the data:

<%
' FP_ASP ASP Automatically generated by a Frontpage Component. Do not Edit.

On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 1255
Session.LCID = 1037
Err.Clear

strErrorUrl = ""

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
	Err.Clear

	Set fp_conn =  Server.CreateObject("ADODB.Connection")
	FP_DumpError strErrorUrl, "Cannot create connection"

	Set fp_rs = Server.CreateObject("ADODB.Recordset")
	FP_DumpError strErrorUrl, "Cannot create record set"

	fp_conn.Open Application("db_ConnectionString")
	FP_DumpError strErrorUrl, "Cannot open database"

	fp_rs.Open "Products", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
	FP_DumpError strErrorUrl, "Cannot open record set"

	fp_rs.AddNew
	FP_DumpError strErrorUrl, "Cannot add new record set to the database"
	Dim arFormFields0(5)
	Dim arFormDBFields0(5)
	Dim arFormValues0(5)

	arFormFields0(0) = "employeeName"
	arFormDBFields0(0) = "employeeName"
	arFormValues0(0) = Request("employeeName")
	arFormFields0(1) = "taarich"
	arFormDBFields0(1) = "taarich"
	arFormValues0(1) = Request("taarich")
	arFormFields0(2) = "priceSold"
	arFormDBFields0(2) = "priceSold"
	arFormValues0(2) = Request("priceSold")
	arFormFields0(3) = "productName"
	arFormDBFields0(3) = "productName"
	arFormValues0(3) = Request("productName")
	arFormFields0(4) = "buyer"
	arFormDBFields0(4) = "soldTo"
	arFormValues0(4) = Request("buyer")

	FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0


	fp_rs.Update
	FP_DumpError strErrorUrl, "Cannot update the database"

	fp_rs.Close
	fp_conn.Close

	FP_FormConfirmation "text/html; charset=windows-1255",_
						"Form Confirmation",_
						"Thank you for submitting the following information:",_
						"submission_form.asp",_
						"Return to the form."

End If
End If

Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")

%>
<% Response.Buffer = True %>

<html dir="rtl">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
<meta http-equiv="Content-Language" content="he">
<title>מכירה חדשה</title>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>

<body background="http://***/images/bg.gif">
<!--#include file="../../../../head.inc"-->

<p>

<form METHOD="POST" action="--WEBBOT-SELF--" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1">

<!--webbot bot="SaveDatabase" SuggestedExt="asp" S-DataConnection="db" S-RecordSource="Products"  S-Form-Fields="employeeName taarich priceSold productName buyer" S-Form-DBFields="employeeName taarich priceSold productName soldTo" U-ASP-Include-Url="../../../_fpclass/fpdbform.inc" startspan U-Database-URL="../../../../fpdb/db.mdb" --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include file="../../../_fpclass/fpdbform.inc"--><!--webbot bot="SaveDatabase" endspan i-checksum="52631" -->

<table border="1" width="54%" id="table1" cellpadding="2" bordercolor="#800080">
	<tr>
		<td>תאריך המכירה </td>
		<td><span dir="rtl">
		<!--webbot bot="Validation" s-display-name="taarich" s-data-type="String" b-value-required="True" i-maximum-length="0" --><input type="TEXT" name="taarich" size="19" value="<%=Date%>"></span></td>
	</tr>
	<tr>
		<td>שם המוצר הנמכר</td>
		<td><span dir="rtl">
		<!--webbot bot="Validation" s-display-name="productName" s-data-type="String" b-value-required="True" i-maximum-length="255" --><input type="TEXT" name="productName" size="64" value="" maxlength="255"></span></td>
	</tr>
	<tr>
		<td>סכום המכירה</td>
		<td><span dir="rtl">
		<!--webbot bot="Validation" s-display-name="priceSold" s-data-type="String" b-value-required="True" i-maximum-length="255" --><input type="TEXT" name="priceSold" size="64" value="" maxlength="255"></span></td>
	</tr>
	<tr>
		<td>שם המוכר</td>
		<td><span dir="rtl"><nobr>
		<!--webbot bot="DatabaseRegionStart" s-columnnames="Key,employeeName,employeeMobile,employeeEmail,employeeAddress,employeePassword" s-columntypes="3,202,202,202,202,3" s-dataconnection="db" b-tableformat="FALSE" b-menuformat="TRUE" s-menuchoice="employeeName" s-menuvalue="employeeName" b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource="Employees" s-displaycolumns="Key,employeeName,employeeMobile,employeeEmail,employeeAddress,employeePassword" s-criteria s-order="[employeeName] -" s-sql="SELECT * FROM Employees ORDER BY employeeName DESC" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields s-norecordsfound="No records returned." i-maxrecords="0" i-groupsize="0" botid="0" u-dblib="../../../../_fpclass/fpdblib.inc" u-dbrgn1="../../../../_fpclass/fpdbrgn1.inc" u-dbrgn2="../../../../_fpclass/fpdbrgn2.inc" preview=" <span style="color: rgb(0,0,0); background-color: rgb(255,255,0)">Database</span> " startspan --><!--#include file="../../../../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Employees ORDER BY employeeName DESC"
fp_sDefault=""
fp_sNoRecords="No records returned."
fp_sDataConn="db"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="employeeName"
fp_sMenuValue="employeeName"
fp_sColTypes="&Key=3&employeeName=202&employeeMobile=202&employeeEmail=202&employeeAddress=202&employeePassword=3&"
fp_iDisplayCols=6
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="37823" --><select NAME="employeeName" SIZE="1">
		<!--webbot bot="AspInclude" clientside u-incfile="../../../../_fpclass/fpdbrgn1.inc" startspan --><!--#include file="../../../../_fpclass/fpdbrgn1.inc"--><!--webbot bot="AspInclude" endspan i-checksum="3394" -->
		<option><%=FP_FieldHTML(fp_rs,"employeeName")%></option>
		<!--webbot bot="AspInclude" clientside u-incfile="../../../../_fpclass/fpdbrgn2.inc" startspan --><!--#include file="../../../../_fpclass/fpdbrgn2.inc"--><!--webbot bot="AspInclude" endspan i-checksum="3522" -->
		</select><!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE" b-menuformat="TRUE" u-dbrgn2="../../../../_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside preview=" <span style="color: rgb(0,0,0); background-color: rgb(255,255,0)">Results</span> " startspan --><!--webbot bot="DatabaseRegionEnd" endspan --></nobr></span></td>
	</tr>
	<tr>
		<td>שם הקונה</td>
		<td><span dir="rtl"><nobr>
		<!--webbot bot="DatabaseRegionStart" s-columnnames="Key,firstName,lastName,sex,address,homePhone,mobilePhone,product,dateOfBirth,colorType,color1,color2,color3,oxygen,notes" s-columntypes="3,202,202,202,202,202,202,202,135,202,202,202,202,202,202" s-dataconnection="db" b-tableformat="FALSE" b-menuformat="TRUE" s-menuchoice="lastName" s-menuvalue="mobilePhone" b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource="Results" s-displaycolumns="Key,firstName,lastName,sex,address,homePhone,mobilePhone,product,dateOfBirth,colorType,color1,color2,color3,oxygen,notes" s-criteria s-order s-sql="SELECT * FROM Results" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields s-norecordsfound="No records returned." i-maxrecords="0" i-groupsize="0" botid="1" u-dblib="../../../../_fpclass/fpdblib.inc" u-dbrgn1="../../../../_fpclass/fpdbrgn1.inc" u-dbrgn2="../../../../_fpclass/fpdbrgn2.inc" preview=" <span style="color: rgb(0,0,0); background-color: rgb(255,255,0)">Database</span> " startspan --><!--#include file="../../../../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Results"
fp_sDefault=""
fp_sNoRecords="No records returned."
fp_sDataConn="db"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="lastName"
fp_sMenuValue="mobilePhone"
fp_sColTypes="&Key=3&firstName=202&lastName=202&sex=202&address=202&homePhone=202&mobilePhone=202&product=202&dateOfBirth=135&colorType=202&color1=202&color2=202&color3=202&oxygen=202¬es=202&"
fp_iDisplayCols=15
fp_fCustomQuery=False
BOTID=1
fp_iRegion=BOTID
%>
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="54303" --><select NAME="buyer" SIZE="1">
		<!--webbot bot="AspInclude" clientside u-incfile="../../../../_fpclass/fpdbrgn1.inc" startspan --><!--#include file="../../../../_fpclass/fpdbrgn1.inc"--><!--webbot bot="AspInclude" endspan i-checksum="3394" -->
		<option VALUE="<%=FP_FieldHTML(fp_rs,"mobilePhone")%>" selected><%=FP_FieldHTML(fp_rs,"lastName")%>
		</option>
		<!--webbot bot="AspInclude" clientside u-incfile="../../../../_fpclass/fpdbrgn2.inc" startspan --><!--#include file="../../../../_fpclass/fpdbrgn2.inc"--><!--webbot bot="AspInclude" endspan i-checksum="3522" -->
		</select><!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE" b-menuformat="TRUE" u-dbrgn2="../../../../_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside preview=" <span style="color: rgb(0,0,0); background-color: rgb(255,255,0)">Results</span> " startspan --><!--webbot bot="DatabaseRegionEnd" endspan --></nobr></span></td>
	</tr>
</table>


<p><span dir="rtl"><input type="submit" value="   שלח   "></span></p>

</form>

</body>
</html>







the query page:



<html dir="rtl">

<head>
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_CharSet = "windows-1255"
FP_CodePage = 1255 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_LCID = 1037 %>
<meta http-equiv="Content-Language" content="he">
<title>New Page 1</title>
</head>

<body>

<form method="POST" action="--WEBBOT-SELF--">
	<!--webbot bot="SaveResults" U-File="../../../../_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" i-checksum="43374" endspan -->
	<p><nobr>
	<!--webbot bot="DatabaseRegionStart" s-columnnames="Key,employeeName,employeeMobile,employeeEmail,employeeAddress,employeePassword" s-columntypes="3,202,202,202,202,3" s-dataconnection="db" b-tableformat="FALSE" b-menuformat="TRUE" s-menuchoice="employeeName" s-menuvalue="employeeName" b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource="Employees" s-displaycolumns="Key,employeeName,employeeMobile,employeeEmail,employeeAddress,employeePassword" s-criteria s-order s-sql="SELECT * FROM Employees" 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" preview=" <span style="color: rgb(0,0,0); background-color: rgb(255,255,0)">Database</span> " startspan --><!--#include file="../../../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Employees"
fp_sDefault=""
fp_sNoRecords="No records returned."
fp_sDataConn="db"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="employeeName"
fp_sMenuValue="employeeName"
fp_sColTypes="&Key=3&employeeName=202&employeeMobile=202&employeeEmail=202&employeeAddress=202&employeePassword=3&"
fp_iDisplayCols=6
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="61091" --><select NAME="employeeName" SIZE="1">
	<!--webbot bot="AspInclude" clientside u-incfile="../../../../_fpclass/fpdbrgn1.inc" startspan --><!--#include file="../../../../_fpclass/fpdbrgn1.inc"--><!--webbot bot="AspInclude" endspan i-checksum="3394" -->
	<option value="<%=FP_FieldHTML(fp_rs,"employeeName")%>"><%=FP_FieldHTML(fp_rs,"employeeName")%></option>
	<!--webbot bot="AspInclude" clientside u-incfile="../../../../_fpclass/fpdbrgn2.inc" startspan --><!--#include file="../../../../_fpclass/fpdbrgn2.inc"--><!--webbot bot="AspInclude" endspan i-checksum="3522" -->
	</select><!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE" b-menuformat="TRUE" u-dbrgn2="../../../../_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside preview=" <span style="color: rgb(0,0,0); background-color: rgb(255,255,0)">Results</span> " startspan --><!--webbot bot="DatabaseRegionEnd" endspan --></nobr></p>
	<p>התחלה <input type="text" name="startd" size="20" value="dd/mm/yyyy"></p>
	<p>סיום <input type="text" name="endd" size="20" value="dd/mm/yyyy"></p>
	<table width="100%" border="1">
		<thead>
			<tr>
				<th ALIGN="LEFT"><b>employeeName</b></th>
				<th ALIGN="LEFT"><b>totalSales</b></th>
				<th ALIGN="LEFT"><b>productName</b></th>
			</tr>
		</thead>
		<tbody>
			<!--webbot bot="DatabaseRegionStart" s-columnnames="employeeName,totalSales,productName" s-columntypes="3,5,202" s-dataconnection="db" 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="FALSE" s-recordsource s-displaycolumns="employeeName,totalSales,productName" s-criteria s-order s-sql="SELECT employeeName, Sum(priceSold) AS totalSales, productName FROM Products GROUP BY employeeName, productName" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields s-norecordsfound="No records returned." i-maxrecords="0" i-groupsize="0" botid="1" u-dblib="../../../../_fpclass/fpdblib.inc" u-dbrgn1="../../../../_fpclass/fpdbrgn1.inc" u-dbrgn2="../../../../_fpclass/fpdbrgn2.inc" tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" width="100%"><font color="#000000">This is the start of a Database Results region.</font></td></tr>" startspan --><!--#include file="../../../../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT employeeName, Sum(priceSold) AS totalSales, productName FROM Products GROUP BY employeeName, productName"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=3 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="db"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&employeeName=3&totalSales=5&productName=202&"
fp_iDisplayCols=3
fp_fCustomQuery=True
BOTID=1
fp_iRegion=BOTID
%>
<!--#include file="../../../../_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="12684" --><tr>
				<td>
				<!--webbot bot="DatabaseResultColumn" s-columnnames="employeeName,totalSales,productName" s-column="employeeName" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1">&lt;&lt;</font>employeeName<font size="-1">&gt;&gt;</font>" startspan --><%=FP_FieldVal(fp_rs,"employeeName")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="30904" --></td>
				<td>
				<!--webbot bot="DatabaseResultColumn" s-columnnames="employeeName,totalSales,productName" s-column="totalSales" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1">&lt;&lt;</font>totalSales<font size="-1">&gt;&gt;</font>" startspan --><%=FP_FieldVal(fp_rs,"totalSales")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="33131" --></td>
				<td>
				<!--webbot bot="DatabaseResultColumn" s-columnnames="employeeName,totalSales,productName" s-column="productName" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1">&lt;&lt;</font>productName<font size="-1">&gt;&gt;</font>" startspan --><%=FP_FieldVal(fp_rs,"productName")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="32605" --></td>
			</tr>
			<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="../../../../_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" width="100%"><font color="#000000">This is the end of a Database Results region.</font></td></tr>" startspan --><!--#include file="../../../../_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="3554" --></tbody>
	</table>
	<p> </p>
	<p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
	<p> </p>
</form>

</body>

</html>


(in reply to BeTheBall)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> summing up sales
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts