Ask a Question related to Dreamweaver AppDev, Design and Development.
-
Tim Mannah #1
SQL statement For a recordset
I have 2 tables tbMembers and tbMembersAccessLvl
I know that a person may have more that one accesslevel in the
tbMemberAccessLvl, I only want to retrieve the highest number (the access
level can only be 0,1,2).
The statement below is retrieveing the lowest one because its the first one
it comes across.
SELECT tbMembers.MemberId, tbMembers.MemberPass, tbMembers.email,
tbMemberAccessLvl.AccessLvl
FROM tbMembers CROSS JOIN tbMemberAccessLvl
WHERE (tbMembers.MemberId = '402195') AND (tbMembers.MemberPass =
'ebony')
How can i get the record that supports the above statement but also gets the
highest tbMemberAccessLvl.AccessLvl.
There might be 3 records that have MemberId = '402195' and MemberPass =
'ebony' but i want the one with the highest value in
tbMemberAccessLvl.AccessLvl. Do i need to use the MAX prefix??
I tried SELECT tbMembers.MemberId, tbMembers.MemberPass,
tbMembers.email, MAX(tbMemberAccessLvl.AccessLvl) but the server said I need
a "Group by" not sure how any ideas.
This select statement is what I will change the recordest in DWMX2004 to be
instead of the normal recordset from one table. Please help
Tim Mannah Guest
-
Need help with a recordset
I need some help with a recordset that selects a series of items with options. The problem is when I select the item it shows a list of options.... -
RECORDSET
I am trying to make a data base for a ASP website. But when I try to write the code DataSet11.Recordset.Addnew. Appears error when I compile to... -
ASP Recordset Help!
Hi, I have been trying to construct a results page in dreamweaver/asp if i put a search in with one parameter it works fine (ie, select name from... -
Is this possible with a recordset?
Hello, Looking for some expert help. I am using Dreamweaver MX 2004. I have a need that I was wondering if it was possible accomplish using a... -
RecordSet.Move or RecordSet.AbsolutePosition??
Hi, I'm trying to use either one of these methods to position the cursor in a specific position inside a recordset, but neither one seems to... -
Singularity.co.uk #2
Re: SQL statement For a recordset
Tim
Would the below work:
SELECT Top 1 tbMembers.MemberId, tbMembers.MemberPass, tbMembers.email,
tbMemberAccessLvl.AccessLvl
FROM tbMembers CROSS JOIN tbMemberAccessLvl
WHERE (tbMembers.MemberId = '402195') AND (tbMembers.MemberPass =
'ebony')
ORDER BY tbMemberAccessLvl.AccessLvl DESC
Brendan
"Tim Mannah" <timm@diabetesnsw.com.au> wrote in message
news:d0qlc8$gjr$2@forums.macromedia.com...one> I have 2 tables tbMembers and tbMembersAccessLvl
>
> I know that a person may have more that one accesslevel in the
> tbMemberAccessLvl, I only want to retrieve the highest number (the access
> level can only be 0,1,2).
> The statement below is retrieveing the lowest one because its the firstthe> it comes across.
>
> SELECT tbMembers.MemberId, tbMembers.MemberPass, tbMembers.email,
> tbMemberAccessLvl.AccessLvl
> FROM tbMembers CROSS JOIN tbMemberAccessLvl
> WHERE (tbMembers.MemberId = '402195') AND (tbMembers.MemberPass =
> 'ebony')
>
> How can i get the record that supports the above statement but also getsneed> highest tbMemberAccessLvl.AccessLvl.
>
> There might be 3 records that have MemberId = '402195' and MemberPass =
> 'ebony' but i want the one with the highest value in
> tbMemberAccessLvl.AccessLvl. Do i need to use the MAX prefix??
>
> I tried SELECT tbMembers.MemberId, tbMembers.MemberPass,
> tbMembers.email, MAX(tbMemberAccessLvl.AccessLvl) but the server said Ibe> a "Group by" not sure how any ideas.
>
> This select statement is what I will change the recordest in DWMX2004 to> instead of the normal recordset from one table. Please help
>
>
Singularity.co.uk Guest
-
Tim Mannah #3
Re: SQL statement For a recordset
This just orders them but doesnt issolated the specific access level the MAX
ended up working when i added a group by clause that groups by all fields
except the one being MAX'ed
"Tim Mannah" <timm@diabetesnsw.com.au> wrote in message
news:d0qlc8$gjr$2@forums.macromedia.com...one> I have 2 tables tbMembers and tbMembersAccessLvl
>
> I know that a person may have more that one accesslevel in the
> tbMemberAccessLvl, I only want to retrieve the highest number (the access
> level can only be 0,1,2).
> The statement below is retrieveing the lowest one because its the firstthe> it comes across.
>
> SELECT tbMembers.MemberId, tbMembers.MemberPass, tbMembers.email,
> tbMemberAccessLvl.AccessLvl
> FROM tbMembers CROSS JOIN tbMemberAccessLvl
> WHERE (tbMembers.MemberId = '402195') AND (tbMembers.MemberPass =
> 'ebony')
>
> How can i get the record that supports the above statement but also getsneed> highest tbMemberAccessLvl.AccessLvl.
>
> There might be 3 records that have MemberId = '402195' and MemberPass =
> 'ebony' but i want the one with the highest value in
> tbMemberAccessLvl.AccessLvl. Do i need to use the MAX prefix??
>
> I tried SELECT tbMembers.MemberId, tbMembers.MemberPass,
> tbMembers.email, MAX(tbMemberAccessLvl.AccessLvl) but the server said Ibe> a "Group by" not sure how any ideas.
>
> This select statement is what I will change the recordest in DWMX2004 to> instead of the normal recordset from one table. Please help
>
>
Tim Mannah Guest



Reply With Quote

