...

View Full Version : How Do You Filter Out Text In Select?



mdwebster
05-18-2007, 03:25 PM
I have a column in a table called 'clients' and 'tracking' and tracking is filled with numbers and text.

Now i want to filter out the text and display only the clients with a tracking that contains numbers.

if (IsNumeric(objRS("tracking"))) then

Set objRS = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM tbl_jobs WHERE DATEVALUE(printdate) BETWEEN " & AccessDate(firstdate) & " AND " & AccessDate(firstdate+6) & "AND tracking <>' " & " " & " ' AND delivery=' " & "adfast" & " ' "
objRS.Open strSQL, objconn

however doesnt seem to work! displays the numbers and text - any ideas?

Daemonspyre
05-19-2007, 01:42 AM
Have you tried using InStr?



SELECT * FROM tbl_jobs WHERE DATEVALUE(printdate) BETWEEN " & AccessDate(firstdate) & " AND " & AccessDate(firstdate+6) & "AND InStr(tracking,' ') = 0 AND InStr(delivery,'adfast') = 0

mdwebster
05-21-2007, 12:40 PM
that filters out the numbers, and displays the text. not the other way round as wanted

Daemonspyre
05-21-2007, 03:18 PM
Can you post a record (or part of a record) so that I can play with it to get it exactly the way you want it?

You may also want to try changing the InStr() from =0 to <>0.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum