Select and insert query
first i have to select 'FromDate' and also 'TODate' from datetimepicker.then click preview button.in preview button ,passing parameters like "customerid","from date" and "to date" and called here "save function",because want to insert some datas into a 'newtable(tblreport)',so i written a query ij sql 2005, in this save function,which is used for select(by using inner join of two table like tblsales and tbl salesitem) and also insert here into a new table for design a report.i have mistake in that query in WHERE condition.i don't know how to give.THE date which is inserted into that new table(tblreport) is invoice date means from date....but first i need date should display one by one in order....if you want my query...i will forward....please help me as soon as possible....in c# windows application
Maneesh A NPosted Nov 29, 2013, 6:54 AM
venkata kumarPosted Nov 29, 2013, 1:45 AM
give mee your query
Maneesh A NPosted Nov 28, 2013, 9:12 AM
venkata kumarPosted Nov 28, 2013, 6:07 AM
try fallowing
insert into purchasemast(Trans_ID,DistCode,Pur_Inv_No,Pur_Inv_Date,Inward_No,Inward_Date,grandtot,netamt,paymt,postages,freight,expense,packing,appno)
(select Trans_ID,DistCode,Pur_Inv_No,Pur_Inv_Date,Inward_No,Inward_Date,grandtot,Netamt,paymt,postages,freight,expense,packing,appno from Purchasemast where pur_invDate between @fromdate and @todate)