Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

.NET Forum


You are currently viewing our .NET Forum as a guest. Please register to participate.
Login



Reply
aspx, access database DOES NOT EQUAL "999"
Old 06-01-2006, 08: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
 
 
Register now for full access!
Old 06-01-2006, 10:15 AM Re: aspx, access database DOES NOT EQUAL "999"
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
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!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-01-2006, 10: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, 12:17 PM Re: aspx, access database DOES NOT EQUAL "999"
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Originally Posted by from 2 posts up
(<> '' or <> '999')

<> '999'
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
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.13496 seconds with 12 queries