S
spartanmba
Is it possible to run a Select Into, Select, and Drop Table statement from an
Access Query? I am use to doing something like this in SQL using begin
transaction statements, but I am not sure how to get Access to do it.
Here is exactly what I am doing.
***SELECT INTO STATEMENT***
SELECT (dbo_fxrates.spot_bid+dbo_fxrates.spot_offer)/2 AS Avg_IncStaRate,
ccy INTO tempFXrates
FROM dbo_fxrates
WHERE format(input_dt,"m")=format(now(),"m") And
format(input_dt,"yy")=format(now(),"yy") And ratetype="Income Statement Rate"
ORDER BY input_dt DESC
***SELECT STATEMENT***
SELECT TOP 10 deal_no, (SELECT TOP 1 Avg_IncStaRate FROM tempfxrates WHERE
tempfxrates.ccy=dbo_deals.ccy ORDER BY input_dt DESC) AS rateFXUSD,
round(IIf(dbo_deals.CCY="EUR" Or
dbo_deals.CCY="GBP",face_value*rateFXUSD,face_value/rateFXUSD),2) AS
USDNotional
FROM dbo_deals
WHERE trans_type="fx"
ORDER BY deal_no DESC
***DROP STATEMENT***
Drop Table tempfxrates
Thanks,
John
Access Query? I am use to doing something like this in SQL using begin
transaction statements, but I am not sure how to get Access to do it.
Here is exactly what I am doing.
***SELECT INTO STATEMENT***
SELECT (dbo_fxrates.spot_bid+dbo_fxrates.spot_offer)/2 AS Avg_IncStaRate,
ccy INTO tempFXrates
FROM dbo_fxrates
WHERE format(input_dt,"m")=format(now(),"m") And
format(input_dt,"yy")=format(now(),"yy") And ratetype="Income Statement Rate"
ORDER BY input_dt DESC
***SELECT STATEMENT***
SELECT TOP 10 deal_no, (SELECT TOP 1 Avg_IncStaRate FROM tempfxrates WHERE
tempfxrates.ccy=dbo_deals.ccy ORDER BY input_dt DESC) AS rateFXUSD,
round(IIf(dbo_deals.CCY="EUR" Or
dbo_deals.CCY="GBP",face_value*rateFXUSD,face_value/rateFXUSD),2) AS
USDNotional
FROM dbo_deals
WHERE trans_type="fx"
ORDER BY deal_no DESC
***DROP STATEMENT***
Drop Table tempfxrates
Thanks,
John