I'm trying to make a Insert Select
query with additional parameters but it doesn't work. Below is my code:
INSERT INTO [epmscdc].[dbo].[billing]
([pid] ,[did] ,[lid] ,[totalamt] ,
[cash] ,[bchange] ,[btrans_date])
SELECT patientlab.did, patientlab.pid,
patientlab.lid, laboratory.lprice
FROM patientlab
INNER JOIN laboratory
ON patientlab.lid = laboratory.lid
INNER JOIN doctor
ON patientlab.did = doctor.did
WHERE patientlab.pid = 3
AND pstatus = '-', 1000,1000,GETDATE())
I just want to select specific field from the other tables and I want to get the cash
,change
,trans_date
from a textbox so how can I do that?