Atul Rokade

Atul Rokade

  • NA
  • 141
  • 44.1k

Is it possible to insert NEW record in table while selecting

Sep 2 2016 5:53 AM
Hi all,
I have two tables Sales_details and Login in Login table have
User_name, Password,Unique_no field( this data filled whenever new user added), Now i have Sales_details table(User_name,Unique_no,Sales_count,To_date) in this table sales detail has enter base on Login table,
Now what i exactly want when salesman done the sales at that time His user_name,unique_no extracted from login table and inserted into Sales_details but while inserting into sales details Sales_count should be 0 by default value when he try to first sale into the day afterwords sales count can be update as per his sales and To_date should be todays date
Now i able to extract User_name and Unique_no from Login to inserted Sales_details but i unable to insert by default value 0 in sales_count and Today date into To_date
note: im using ms-access database  so i cant use trigger and store procedure tell me how can i executed query by c# inline coding??
insert into sales_tables(User_name,Unique_no) select User_name,Unique_no from login where unique_no=@unique_no;

Answers (3)