Reply
aspx, access database DOES NOT EQUAL "999"
Old 06-01-2006, 07:32 AM aspx, access database DOES NOT EQUAL "999"
Experienced Talker

Posts: 48
Trades: 0
hi guys,

i have an asp.net site which i am building in web matrix.

it hooks up to an MS Access backend.

i need to add some criteria to my select statment to firstly ignore records where AWARD is blank or "999"
i will then will need to repeat the whole thing to just select blanks and "999"s.

so my statment is as follows:

Dim sqlCmd2 = "SELECT ur.student_id, ur.unit_id, ur.award, aw.title, un.title, re.title, ur.year, ur.mark, un.cats, ur.field8, ur.prog_id " _ & "

FROM ((UNITREG ur LEFT JOIN AWARD aw ON ur.award = aw.id) " _ & "LEFT JOIN UNIT un ON ur.unit_id = un.id) " _ & "LEFT JOIN RESULT re ON ur.grade = re.id " _ & "

WHERE (ur.student_id = '"& id &"') AND award >= '' " _ & "

ORDER BY aw.title, un.title"

what do i need to add to say WHERE "AWARD" DoesNotEqual blank or "999"

and then in another statement WHERE "AWARD" = blank or "999"

all help is much appriciated!

no time wasters please!
__________________
regards,

Pauly.
The true sign of intelligence is not knowledge but imagination. (Albert Einstein)
Be who you are and say what you feel,
because those who mind don't matter and those who matter don't mind. (Dr. Seuss
)
paulwebmaster is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 06-01-2006, 09:15 AM Re: aspx, access database DOES NOT EQUAL "999"
chrishirst's Avatar
Super Moderator

Posts: 26,524
Location: Blackpool. UK
Trades: 0
running a SELECT while trying to extract both those criteria will probably result in all records being selected as you exclude them with one clause then include them with the second.
Assuming you want them in order of (<> "" or <> "999") first then ("" or "999") to follow, the UNION query is what you need to use (as in my last post in http://www.webmaster-talk.com/the-da...anks-last.html )
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | Crowded Nightclub? | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-01-2006, 09:38 AM Re: aspx, access database DOES NOT EQUAL "999"
Experienced Talker

Posts: 48
Trades: 0
ok, forget my last message.
ive worked out to do the rest of it!!!!!!!!!

i just need to know how to say:

award DOES NOT EQUAL '999'



how do i say does not equal in aspx when connecting to an MS access db???????
__________________
regards,

Pauly.
The true sign of intelligence is not knowledge but imagination. (Albert Einstein)
Be who you are and say what you feel,
because those who mind don't matter and those who matter don't mind. (Dr. Seuss
)
paulwebmaster is offline
Reply With Quote
View Public Profile
 
Old 06-01-2006, 11:17 AM Re: aspx, access database DOES NOT EQUAL "999"
chrishirst's Avatar
Super Moderator

Posts: 26,524
Location: Blackpool. UK
Trades: 0
Quote:
Originally Posted by from 2 posts up
(<> '' or <> '999')

<> '999'
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | Crowded Nightclub? | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to aspx, access database DOES NOT EQUAL "999"
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.09566 seconds with 13 queries