Wilson Hew
New member
- Local time
- Today, 22:44
- Joined
- Jan 21, 2003
- Messages
- 7
Can I insert record from the SELECT statement as below:
INSERT INTO Table1(Field1, Field2)
SELECT B.Field1, Count(B.Field1)
FROM Table2 B
WHERE (B.Field2 BETWEEN #01/01/2003# AND #25/01/2003#)
GROUP BY B.Field1;
I have tried in MS Access 2000, it gave me error. It said data type conversion error!
Below is the data structure:
Table1
=====
Field1 ---> Text - 15
Field2 ---> Number - Integer
Table2
=====
Field1 ---> Text - 15
Field2 ---> Date/Time
Can I cast the data type in the SELECT. If not, how? Please help. Thanks.
Wilson
INSERT INTO Table1(Field1, Field2)
SELECT B.Field1, Count(B.Field1)
FROM Table2 B
WHERE (B.Field2 BETWEEN #01/01/2003# AND #25/01/2003#)
GROUP BY B.Field1;
I have tried in MS Access 2000, it gave me error. It said data type conversion error!
Below is the data structure:
Table1
=====
Field1 ---> Text - 15
Field2 ---> Number - Integer
Table2
=====
Field1 ---> Text - 15
Field2 ---> Date/Time
Can I cast the data type in the SELECT. If not, how? Please help. Thanks.
Wilson