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!

Insert Query with condition 1

Status
Not open for further replies.

hianjali

Programmer
Jan 5, 2006
29
US
Hi, with my query, it is inserting all the data from bilact table to my temptable tblCurrent_Month. But I just need to insert the data where the month of Bcr_Billing_period. Ie I give 01/23/2006 it needs to pick the data where Bcr_Billing_Period is between 01/01/2006 to 01/31/2006.

My data for BCR_Billing_period is like this 200210 (only year and month)

SELECT Bilact.Bcr_Group_num, Bilact.Bcr_Group_loc, Bilact.Bcr_Billing_Period, Bilact.Bcr_Billed_Amount
INTO tblCurrent_Month
FROM bilact

Please help
 
Something like this ?
SELECT Bcr_Group_num, Bcr_Group_loc, Bcr_Billing_Period, Bcr_Billed_Amount
INTO tblCurrent_Month
FROM bilact
WHERE Bcr_Billing_Period = Format(Now(), 'yyyymm')

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top