Register Blogs FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

Sponsored Links

Discuss "selecting value" in the ASP Development forum.

ASP Development - Learn coding practices and tips to get the best out of your Active Server Pages (ASP). Visit the ASP Development forum for help with ASP/VBScript and ASP/JScript applications.


Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old June 21st, 2008, 10:05 AM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default selecting value

Hi,

I have a table the design is like this

ID
Description


In description the field can hold values in 2 ways

Tee - Shirt XL
Tee-shirt Size - None


Either the sizes will be S, M, L, XL, XXL, XXXL after Tee - Shirt

What i want to do is check what value the field has

If it has Tee-shirt Size - None then set the strtshirt variable to No Tshirt

If the value is like this Tee - Shirt S or Tee - Shirt M or Tee - Shirt L or Tee - Shirt XL or Tee - Shirt XXL or Tee - Shirt XXXL


then get the shirt size like S, M, L, XL, XXL, XXXL and store it in the variable strtshirt

I am having problems how to query the table and then extract the shirt size


todd
Reply With Quote
Sponsored Links
  #2  
Old June 23rd, 2008, 01:59 AM
don94403's Avatar
Moderator
 
Join Date: Mar 2008
Location: San Mateo, CA, USA
Posts: 63
Thanks: 3
Thanked 8 Times in 8 Posts
Blog Entries: 2
Rep Power: 1
don94403 is on a distinguished road

Awards Showcase
Microsoft Access PHP 
Total Awards: 2

Default

I responded to your question in ASPFree forums. Check there.
Reply With Quote
  #3  
Old June 23rd, 2008, 08:53 AM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

I know the table design was poor but it holds 111,000 records I dont have permission to change it thats the problem
Reply With Quote
  #4  
Old June 23rd, 2008, 09:20 AM
BLaaaaaaaaaarche's Avatar
Moderator
 
Join Date: Mar 2008
Posts: 55
Thanks: 10
Thanked 7 Times in 5 Posts
Rep Power: 1
BLaaaaaaaaaarche is on a distinguished road

Awards Showcase
HTML & CSS Classic ASP 
Total Awards: 2

Default

Why not use a LIKE query to search for fields that contain "tee" and "shirt":

Code:
strSQL = "SELECT * FROM MyTable WHERE MyField LIKE '%tee%' AND MyField LIKE '%shirt%'"
Then, once you have those, you can use some logic to split apart those strings. Hopefully you will be left with the size.

Comments on this post
jmurrayhead agrees: indeed
__________________
"You'll never be as perfect as BLaaaaaaaaarche."
Reply With Quote
Reply

  DeveloperBarn Forums > Programming & Scripting > ASP Development

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -4. The time now is 05:59 PM.



Content Relevant URLs by vBSEO 3.2.0