Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
SELECT [Qnos]
FROM [i]YourTable[/i]
ORDER BY Left([Qnos],1) DESC , Right([Qnos],1);
'adapted from a Dev Ashish function
'************ Code Start **********
Public Function pfExtractNum(ByVal strInString As String) As String
Dim lngLen As Long
Dim strOut As String
Dim i As Long
Dim strTmp As String
lngLen = Len(strInString)
strOut = vbNullString
For i = 1 To lngLen
strTmp = Left$(strInString, 1)
strInString = Right$(strInString, lngLen - i)
If (Asc(strTmp) >= 48 And Asc(strTmp) <= 57) Then
strOut = strOut & strTmp
End If
Next i
If IsNumeric(strOut) Then
pfExtractNum = CLng(strOut)
End If
End Function
SELECT pfExtractNum([QNos]) AS Qnum
FROM tblTABLE
ORDER BY pfExtractNum([QNos]);
Function pfExtractNum(ByVal varIn As Variant) As Variant
Dim lngLen As Long
Dim strOut As String
Dim i As Long
Dim strTmp As String
If Len(varIn) > 0 Then
lngLen = Len(varIn)
strOut = vbNullString
For i = 1 To lngLen
strTmp = Left$(varIn, 1)
varIn = Right$(varIn, lngLen - i)
If (Asc(strTmp) >= 48 And Asc(strTmp) <= 57) Then
strOut = strOut & strTmp
End If
Next i
If IsNumeric(strOut) Then
pfExtractNum = CLng(strOut)
End If
Else
pfExtractNum = varIn
End If