Feb 25, 2007 #1 button71 Programmer Joined Nov 8, 2006 Messages 69 Location AU I have Code: SELECT * FROM PTEMP ; INTO TABLE pictures ; ORDER BY Fname I wish to exclude all files except jpg , bmp , tif, gif etc Can anyone help? Thanks William
I have Code: SELECT * FROM PTEMP ; INTO TABLE pictures ; ORDER BY Fname I wish to exclude all files except jpg , bmp , tif, gif etc Can anyone help? Thanks William
Feb 25, 2007 #2 mm0000 IS-IT--Management Joined May 19, 2002 Messages 295 Location IN Try the following code. Fieldname in the query represents the field containing the names of the files. Code: SELECT * FROM PTEMP ; INTO TABLE pictures ; where justext(fieldname) $ 'jpg/bmp/tif/gif' ; ORDER BY Fname Upvote 0 Downvote
Try the following code. Fieldname in the query represents the field containing the names of the files. Code: SELECT * FROM PTEMP ; INTO TABLE pictures ; where justext(fieldname) $ 'jpg/bmp/tif/gif' ; ORDER BY Fname
Feb 26, 2007 #3 Mike Lewis Programmer Joined Jan 10, 2003 Messages 17,516 Location Scotland MM0000, where justext(fieldname) $ 'jpg/bmp/tif/gif' Click to expand... As William wants to exclude the specified extensions, you need a NOT in there. Also, it would be a good idea to wrap the JUSTEXT(fieldname) in a LOWER(), to avoid any issues with case. Mike __________________________________ Mike Lewis (Edinburgh, Scotland) My Visual FoxPro site: www.ml-consult.co.uk Upvote 0 Downvote
MM0000, where justext(fieldname) $ 'jpg/bmp/tif/gif' Click to expand... As William wants to exclude the specified extensions, you need a NOT in there. Also, it would be a good idea to wrap the JUSTEXT(fieldname) in a LOWER(), to avoid any issues with case. Mike __________________________________ Mike Lewis (Edinburgh, Scotland) My Visual FoxPro site: www.ml-consult.co.uk
Feb 26, 2007 #4 mm0000 IS-IT--Management Joined May 19, 2002 Messages 295 Location IN Mike, Button71 wrote : I wish to exclude all files except jpg , bmp , tif, gif etc Click to expand... I think he wants to exclude all files other than image files from the query. In other words only image files are to be selected by the query. Yes, wrapping the statement with LOWER() is required to avoid case issues, the query can be changed to Code: SELECT * FROM PTEMP ; INTO TABLE pictures ; where lower(justext(fieldname)) $ 'jpg/bmp/tif/gif' ; ORDER BY Fname Upvote 0 Downvote
Mike, Button71 wrote : I wish to exclude all files except jpg , bmp , tif, gif etc Click to expand... I think he wants to exclude all files other than image files from the query. In other words only image files are to be selected by the query. Yes, wrapping the statement with LOWER() is required to avoid case issues, the query can be changed to Code: SELECT * FROM PTEMP ; INTO TABLE pictures ; where lower(justext(fieldname)) $ 'jpg/bmp/tif/gif' ; ORDER BY Fname
Feb 26, 2007 #5 Mike Lewis Programmer Joined Jan 10, 2003 Messages 17,516 Location Scotland mm0000, You're right. My mistake. I was caught by the double negative. Mike __________________________________ Mike Lewis (Edinburgh, Scotland) My Visual FoxPro site: www.ml-consult.co.uk Upvote 0 Downvote
mm0000, You're right. My mistake. I was caught by the double negative. Mike __________________________________ Mike Lewis (Edinburgh, Scotland) My Visual FoxPro site: www.ml-consult.co.uk