>>I'm having to do a SQL Select on an Access 95 database.
>>
>>One of the fields is type Currency.
>>
>>The value passed over to compare it to is of type Numeric.... so I get an operator/operand type mismatch.
>>
>>What is an easy way to compare the two?
>>
>>Thanks
>
>Can you show some code? It supposed to work. Maybe can you try to explicitly convert using CCUR.
Here is some of the code...
*******************************************************************
sConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + ;
m_sMdbPath + "pccw.mdb;Persist Security Info=False"
oConn = CREATEOBJECT("ADODB.Connection")
oConn.OPEN(sConn)
*Select the cursor tfipost
SELECT tfipost
*Look at all it's records
SCAN
DO chktrans WITH tfipost.ship_id, tfipost.ordertotal, m_lcMerchantNumber ,oConn
ENDSCAN
oConn.CLOSE
RELEASE oConn
ENDIF Post-Authorization
***************************************************************************************
* *
* *
***************************************************************************************
PROCEDURE chkTrans
PARAMETER m_ship_id, m_ordertotal, m_lcMerNum, m_oConn
SUSPEND
lsShip_id = PADR(ALLTRIM(STR(m_ship_id)),10)
lsOrderTotal = STR(m_ordertotal,6,2)
*-- Get orders for Post-Authorization.
sSQL = "SELECT trans.* " + ;
"FROM trans " + ;
"WHERE trans.ticket = '" + lsShip_id + "' " + ;
"AND trans.tid = '" + m_lcMerNum + "' " + ;
"AND trans.amount = '" + lsOrderTotal + "' "
oHeader = CREATEOBJECT("ADODB.Recordset")
oHeader.OPEN(sSQL, m_oConn)
*****************
Crashes on the OPEN statement....
with error
"OLE (Dispatch exception code 0 from Microsoft Jet Database Engine : Data type mismatch in criteria expression....
*******************
The error has been pinned down to the Currency value in TRANS.amount and the string value in lsOrderTotal.
I"m going to try some of the Numeric to Currency Functions to see if they help.
Tommy
Tommy Tillman A+ NetWork+ MCP