Microsoft
Software
Hardware
Network
Question : MAX(SUBSTRING(variable,6,6)) only goes to 10???
Hi.
I thought I solved my problem, but a new one arised from my solution. Here it is:
xpresentyear = Request.Form("presentyear"
)
sSQL_rs = "SELECT IsNull(MAX(SUBSTRING(chain
link,6,6))
,0) AS chain_number_max FROM tbl_registrer WHERE SUBSTRING(chainlink,1,4) LIKE DATEPART(year, getdate());"
Set rs=objConn.execute(sSQL_rs
)
Then I INSERT this value into the table:
'" & xpresentyear & "'+'-'+'" & replace(rs("chain_number_m
ax")+1,"'"
,"''") & "'
Now... it seems it won't get beyond 10! How comes??? Is something wrong with the datatype (it's coming from part of a varchar-field)? Can I put in some more code so that it is interpreted as a number and not "text-number"? It seems to me that the MAX(SUBSTRING(chainlink,6,
6)) only look after the first digit in the number...
Please HELP!
Best regards
Ullenulle
Related Solutions:
Calculated variable on server...
Answer : MAX(SUBSTRING(variable,6,6)) only goes to 10???
Actually, this appears to the be the correct SQL:
ISNULL(MAX(CAST(SUBSTRING(
chainlink,
6, 6) AS int)), 0)
Random Solutions
How can I multiply table 1 column by table 2 column then add all the results?
NAT ROUTE on ASA from OUTSIDE MAIL SERVER on DIFFERENT IP SPACE
Split data from one column into 2 columns
Multiple Dll's in Delphi
Symantec BackupExec 2010 VMware ESX 3.5 x64 guests fails with 'An attempt to take a snapshot of a virtual machine failed because it was unable to quiesce an application'
HP ML110 Disk Array failed
How can the AD objects deletion reflect in WSUS console immediately.
Random Excel 2007 crashes
where does oracle enterprise manger look
BULK UPDATE