SQL Query for automatic creation of Item Code
Hi - A contact of mine is asking this question about SQL Query which is out of my knowledge. Please can anyone help?
Hi,thanks for the help,i've one more problem.i have made a query for automatically creation of item code in item name field but it didn't work.can u help me that it is right or wrong.query that i've made is below.
SELECT substring ((MAX(T0.ItemCode)), 0,4)cast ((Substring ((MAX(T0.ItemCode)),4,4)1) AS varchar(20))
FROM OITM T0
WHERET0.ItmsGrpCod = $[OITM.ItmsGrpCod]
whenever i execute this query i get an error like this:- 1). [SQL Native Client][SQL Server]Incorrect syntax near the keyword 'SELECT'. 2). [SQL Native Client][SQL Server]Incorrect syntax near 'OITM.ItmsGrpCod'. 3). [SQL Native Client][SQL Server]Statement 'Service Contracts' (OCTR) (s) could not be prepared.so how could i genrate item code automatically and what is the solution of above error,plz tell me asap.i'll wait for ur reply