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

Update query criteris check if laue present 1

Status
Not open for further replies.

ali32j

Technical User
Joined
Apr 23, 2007
Messages
97
Location
GB
Hi All

i m using the following update query to update a table

INSERT INTO StrategyMonthly ( Name, ValueAll, CostAll, CostLDE, ValueLDE, [Month] )
SELECT StrategyCalcs.Name, StrategyCalcs.[Sum Of Net Value], StrategyCalcs.[Sum Of Cost], StrategyCalcs.SumCost, StrategyCalcs.Value, StrategyCalcs.[Billing Date By Month]
FROM StrategyCalcs;

I want it to check if [Month] already contains the month being entered (StrategyCalcs.[Billing Date By Month]) if so not to continue

is this possible? if so can anyone help?

Thanks

Ali
 
INSERT INTO StrategyMonthly ( Name, ValueAll, CostAll, CostLDE, ValueLDE, [Month] )
SELECT StrategyCalcs.Name, StrategyCalcs.[Sum Of Net Value], StrategyCalcs.[Sum Of Cost], StrategyCalcs.SumCost, StrategyCalcs.Value, StrategyCalcs.[Billing Date By Month]
FROM StrategyCalcs
left join StrategyMonthly
on StrategyMonthly.[month]=StrategyCalcs..[Billing Date By Month]
where StrategyMonthly.[month] is null
 
Hi Pwise

Thankyou for your help works perfectly

Ali
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top