Ask a Question related to ASP, Design and Development.
-
Chris Hohmann #1
Re: help with SELECT statement
"Aaron" <abroadway@ameritrust.com> wrote in message
news:05a601c365df$b31a8d40$a401280a@phx.gbl..."SUM(ABS(action_date>= {" & start_date2 & "} and action_date < {" &> I have the the below select statement, which is only part
> of what I need.
>
> Set rsAE = oConn.Execute("Select count(DISTINCT
> GEN.lo_rep, sum(loan_am) as cnt) as total_records from
> Gen.DBF GEN, USERINFO U where (((action_date>= {" &
> (start_date2) & "} and action_date < {" & (end_date)
> & "}) or (app_date>= {" & (start_date2) & "} and app_date
> < {" & (end_date) & "}) and (branch_type = [B]))) " )
>
> **I need to order by the cnt, but I need cnt to be the
> sum of the loan_amt only where action_date>= {" &
> (start_date2) & "} and action_date < {" & (end_date)
> & "})
>
> I do not know how to do this. Please help!!!!! Thanks,
end_date & "})*loan_amt) AS cnt"
Notes:
1. Don't use ODBC. Use OLEDB.
2. Use a stored procedure/parameterized query
3. When posting database related questions, please specify which
database and version you are using and the structure of the tables in
question.
HTH
-Chris
Chris Hohmann Guest
-
Select-And-Update in one statement?
On my site I often do SELECT counter from counters where id = 10 UPDATE counter set counter = counter + 1 Can I somehow merge them into one... -
select statement woes
I hope some one can help me figure this out. I've got a search feature for images and users can enter up to 3 terms and I'm not getting the results... -
SP with Select statement
Hi, I'm trying to select fileds that are in the results of a SP. So I have the table "tblItem" itemID int Identity Key, itemName varchar... -
Select Statement Question (Again)
I have the following simple Select statement which produces an error when I attempt to save it as part of a stored proc. Select InvoiceID,... -
SELECT statement
I have 3 tables: table countryPrice: productID countryId price 1 Italy 90 1 England ... -
Aaron #2
Re: help with SELECT statement
Sorry,
Thanks for the help, but I cannot do a stored prod b/c I
am accessing foxpro tables.
Any onther ideas?
Thanks
part>-----Original Message-----
>"Aaron" <abroadway@ameritrust.com> wrote in message
>news:05a601c365df$b31a8d40$a401280a@phx.gbl...>> I have the the below select statement, which is onlyapp_date>> of what I need.
>>
>> Set rsAE = oConn.Execute("Select count(DISTINCT
>> GEN.lo_rep, sum(loan_am) as cnt) as total_records from
>> Gen.DBF GEN, USERINFO U where (((action_date>= {" &
>> (start_date2) & "} and action_date < {" & (end_date)
>> & "}) or (app_date>= {" & (start_date2) & "} andaction_date < {" &>>> < {" & (end_date) & "}) and (branch_type = [B]))) " )
>>
>> **I need to order by the cnt, but I need cnt to be the
>> sum of the loan_amt only where action_date>= {" &
>> (start_date2) & "} and action_date < {" & (end_date)
>> & "})
>>
>> I do not know how to do this. Please help!!!!! Thanks,
>"SUM(ABS(action_date>= {" & start_date2 & "} andspecify which>end_date & "})*loan_amt) AS cnt"
>
>Notes:
>1. Don't use ODBC. Use OLEDB.
>2. Use a stored procedure/parameterized query
>3. When posting database related questions, pleasethe tables in>database and version you are using and the structure of>question.
>
>HTH
>-Chris
>
>
>.
>Aaron Guest
-
Chris Hohmann #3
Re: help with SELECT statement
"Aaron" <abroadway@ameritrust.com> wrote in message
news:0d5101c36641$ab0673a0$a101280a@phx.gbl...The notes were just afterthoughts. Did you try the following expression> Sorry,
>
> Thanks for the help, but I cannot do a stored prod b/c I
> am accessing foxpro tables.
>
> Any onther ideas?
> Thanks
for cnt?
"SUM(ABS(action_date>= {" & start_date2 & "} and > action_date < {" &
end_date & "})*loan_amt) AS cnt"
Using this expression instead of your existing expression for cnt should
give you the values you're looking for.
HTH-
Chris
Chris Hohmann Guest



Reply With Quote

