Re: INSERT/SELECT and DataType Mismatch



Hi Serge,

The columns listed in the 'SELECT' portion of the statement have a colon
(':') at the beginning of their names, this indicates that they are
parameters and not columns selected from a table.

If this is correct, are you setting the 'datatype' and 'values' for the
parameters before executing the SQL statement?

HTH,

Michael

"Serge Myrand" <info@xxxxxxxxxxxxxxxxxx> wrote in message
news:42D544D8.F3A7DD68@xxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> I get a "Datatype mismatch in criteria expression" error when i execute
> this INSERT query. I use Delphi 7 ADO 2.8 jet 4.0 sp8 Access 2002.
> Parameters are in the good order and are of the good data type. Can you
> see anything else wrong with that query.
>
> INSERT INTO CLIENT_SELL_HIST (PART_NO, MOD_TYPE, QTY, QTY_1,
> INCREASED, X_VALUE, FORMAT_STRING, SELL_MESURE_UNIT, REMARK, REV_NO,
> CLIENT_NO)
> SELECT DISTINCT i.PART_NO, :MOD_TYPE, :QTY, :QTY_1, :INCREASED,
> :X_VALUE, FORMAT_STRING, SELL_MESURE_UNIT, :REMARK, i.REV_NO, CLIENT_NO
> FROM CLIENT_SELL AS cs INNER JOIN INVENTORY AS i ON CS.PART_NO =
> i.PART_NO AND
> CS.REV_NO = i.REV_NO
> WHERE i.PART_NO = :PART_NO AND i.REV_NO = :REV_NO AND CLIENT_NO =
> :CLIENT_NO
>
> Thank you very much for your time
> serge
>
>
>


.