Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have combobox value which is incrementing but it only increment intigers and the value which i am gettin starts with three alphabet charecters, so i wand to enable or remove first three digits or the prefix before i increment my combobox.

simply i want to remove my first three digit of value which is coming to combobox.

this can be done with sql or c# theories.

eg:
RET001
RET002
RET003

i need to remove RET from combobox using c# or from table column using sql.
Posted

1 solution

its easy to do at SQL side with the following query compared to the C# side implementation
SQL
select right(columnsName,LEN(columnsName)-3) from tableName
 
Share this answer
 
v2
Comments
ByakuyaKuchiki 5-Mar-13 3:12am    
i tried what you told me and i am geting this error

'length' is not a recognized built-in function name.

this is my query

select right(cSerialNumber,length(cSerialNumber)-3) from _btblInvoiceLineSN
Jibesh 5-Mar-13 3:17am    
can you also try replacing length with LEN
giri001 5-Mar-13 3:24am    
select right(cSerialNumber,LEN(cSerialNumber)-3) from _btblInvoiceLineSN ....its working.
ByakuyaKuchiki 5-Mar-13 3:25am    
ok its working how can i use this for only last value of the column.
to get last value of the column is i used
SELECT cSerialNumber
FROM _btblInvoiceLineSN
WHERE idInvoiceLineSN = (SELECT Max(idInvoiceLineSN)
FROM _btblInvoiceLineSN)
and my last value is RET001 so i want to select last valuw with out prefix

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900