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

Replace Function 1

Status
Not open for further replies.

kastaman

IS-IT--Management
Sep 24, 2001
181
0
0
CA
Hi there,

I'm looking for a way to convert the results of my query:
INSERT INTO tbl_Client_Volumes ( Form, Impressions )
SELECT DISTINCTROW tbl_Data_Info.Form, Sum(tbl_Data_Info.Impressions) AS [Total Impressions]
FROM tbl_Data_Info, tbl_Client_Data
GROUP BY tbl_Data_Info.Form
HAVING (((tbl_Data_Info.Form) Like 'cspm' Or (tbl_Data_Info.Form)='bcep' Or (tbl_Data_Info.Form)='cspw' Or (tbl_Data_Info.Form)='stdw' Or (tbl_Data_Info.Form)='std1' Or (tbl_Data_Info.Form)='stnd' Or (tbl_Data_Info.Form)='stdm' Or (tbl_Data_Info.Form)='becp' Or (tbl_Data_Info.Form)=' bepc'));

The results of the query are:
Form Impression
BCEP 500
STDW 100
BEPC 250

The expected results I would like to get is:
Form Impression
0009 850

Essentially, I'd like to change the form to show 0009.



Thanks in advance,

Kastaman
 
maybe if you modify it a bit:

INSERT INTO tbl_Client_Volumes ( Form, Impressions )
SELECT DISTINCTROW '0009', Sum(tbl_Data_Info.Impressions) AS [Total Impressions]
FROM tbl_Data_Info, tbl_Client_Data
WHERE (((tbl_Data_Info.Form) Like 'cspm' Or (tbl_Data_Info.Form)='bcep' Or (tbl_Data_Info.Form)='cspw' Or (tbl_Data_Info.Form)='stdw' Or (tbl_Data_Info.Form)='std1' Or (tbl_Data_Info.Form)='stnd' Or (tbl_Data_Info.Form)='stdm' Or (tbl_Data_Info.Form)='becp' Or (tbl_Data_Info.Form)=' bepc'));

Leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top