Jochem van Dieten wrote:

>Jordan Michaels wrote:
>  
>
>>I have a database of items and item numbers, something like this:
>>
>>ID   Item
>>1-12   Apples
>>12-123 Oranges
>>123-1   Bananas
>>
>>Here's the problem that I'm running into: I want to run a query for item 
>>numer 112, but I don't know where the dash is in the Item Number (ID). 
>>Is there any way that I can query the database for the item number and 
>>just have it ignore the dashes that may or may not be in the field name?
>>
>>Right now I'm using a PostgreSQL 7.3 database
>>    
>>
>
>WHERE CAST(REPLACE(ID, '-', '') AS INTEGER) = <cfqueryparam>
>
>If you need to do this often you should consider a funtional index.
>
>Jochem
>  
>
Thanks Jochem! You rock!

-Jordan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:204439
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to