Appending to a table

sbaud2003

Member
Local time
Today, 23:56
Joined
Apr 5, 2020
Messages
186
Hi Everyone
I have a table which will be appended from another table through an Append Quarry. When ever the destination table is empty, it is not working. After adding a record in the destination table ..it works fine. Is there any way to append a Table having no record at the beginning.
 
What does not working mean?
Error message? No record added? Santa doesn't arrive when he's supposed to? ;)

What is the SQL of the Query?
 
Hi. As long as the table exist, an APPEND query should work, I would think. Can you post the SQL statement for your APPEND query?
 
INSERT INTO FINAL_ACCOUNTS ( collection, Expense, TE_NO, TE_DT )
SELECT [CASH ACCOUNTS].collection, [CASH ACCOUNTS].Expense, [CASH ACCOUNTS].TE_NO, [CASH ACCOUNTS].TE_DT
FROM [CASH ACCOUNTS];

Hi. As long as the table exist, an APPEND query should work, I would think. Can you post the SQL statement for your APPEND query?
 
INSERT INTO FINAL_ACCOUNTS ( collection, Expense, TE_NO, TE_DT )
SELECT [CASH ACCOUNTS].collection, [CASH ACCOUNTS].Expense, [CASH ACCOUNTS].TE_NO, [CASH ACCOUNTS].TE_DT
FROM [CASH ACCOUNTS];
Thanks. Yeah, that should work. Can you post a sample db with test data?
 
I can't see anything wrong with that query.

EDIT : as @theDBguy suggest any chance of a stripped-down copy of the DB?
 
Maybe the problem is that [CASH ACCOUNTS] is empty :)
 
Thanks. Yeah, that should work. Can you post a sample db with test data?
THANKS , I GOT THE SOLUTION, ERROR WAS IN APPEND QRY

PLEASE CORRECT THE CODES. I I AM GETTING ERROR TYPOE MISMATCH
X = Nz(DSum("Cost", "RoomOccupations", "MRO_DONE = FALSE" And "[DepartureDate]" < Date))
 
Thanks. Yeah, that should work. Can you post a sample db with test data?
PLEASE CORRECT THE CODES. I I AM GETTING ERROR TYPOE MISMATCH
X = Nz(DSum("Cost", "RoomOccupations", "MRO_DONE = FALSE" And "[DepartureDate]" < Date))
 
PLEASE CORRECT THE CODES. I I AM GETTING ERROR TYPOE MISMATCH
X = Nz(DSum("Cost", "RoomOccupations", "MRO_DONE = FALSE" And "[DepartureDate]" < Date))
How about?
Code:
X = DSum("Cost", "RoomOccupations", "MRO_DONE = FALSE And [DepartureDate] < Date())
 

Users who are viewing this thread

Back
Top Bottom