Yes, I know the SQL support of MS SQL is sometimes *very* different from that of MS Access (go figure, the same company produced those RDBMS <g>) however logic dictates that this should work in MS SQL too (or should it?) Anyway, I have the following table structure:
[somename]
+----+-------+------+-------+--------+
| id | catid | name | order | active |
+----+-------+------+-------+--------+
and here's my SQL statement:
SELECT top.order,
top.name,
top.id,
count(sub.id),
under.order,
under.name,
under.catid,
under.id
FROM
([somename] under left join [somename] sub
on sub.catid=under.id)
left join [somename] top
on under.catid=top.id
WHERE under.active=1
GROUP BY
top.order,
top.name,
top.id,
under.order,
under.name,
under.id,
under.catid
the output in MS Access follows the top.order however when I ran the same SQL statement in MS SQL, it grouped my outputs by [top.name] but both follows the output for the [under.order] Anyone have any fix for this? Thanks
[somename]
+----+-------+------+-------+--------+
| id | catid | name | order | active |
+----+-------+------+-------+--------+
and here's my SQL statement:
SELECT top.order,
top.name,
top.id,
count(sub.id),
under.order,
under.name,
under.catid,
under.id
FROM
([somename] under left join [somename] sub
on sub.catid=under.id)
left join [somename] top
on under.catid=top.id
WHERE under.active=1
GROUP BY
top.order,
top.name,
top.id,
under.order,
under.name,
under.id,
under.catid
the output in MS Access follows the top.order however when I ran the same SQL statement in MS SQL, it grouped my outputs by [top.name] but both follows the output for the [under.order] Anyone have any fix for this? Thanks