|
| |
|
|
jorkel
Posts: 7 From: Kansas City, MO USA Status: offline
|
SQL Statement Problem--Expr1000 - 2/27/2001 23:23:00
Here's my problem. I am trying to list titles grouped by Month and Year but I don't want to repeat the month and year over and over for each title.In the DRW, I have been placing this SQL Statement that I am sure should work: SELECT DISTINCT Mon AND Yr FROM Results WHERE (Title IS NOT NULL) Note: Mon is Month and Yr is Year. But each time I do this, the Edit List Section reads as Expr1000 which gives a result of -1. Now if I only put in Yr and take out Mon, the Edit List Section only reads Yr when it should be reading Title AND Yr. What's going on?
|
|
|
|
Spooky
Posts: 26606 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: SQL Statement Problem--Expr1000 - 2/27/2001 23:05:00
Try this one  SELECT DISTINCT Mon,Yr FROM.....
|
|
|
|
jorkel
Posts: 7 From: Kansas City, MO USA Status: offline
|
RE: SQL Statement Problem--Expr1000 - 2/28/2001 20:58:00
that gets rid of the expr1000 problem but it still doesn't fix the overall problemSELECT DISTINCT Mon, Yr FROM Results WHERE (Title IS NOT NULL) This statement ends up only displaying Mon and Yr. I still need Title in there.
|
|
|
|
Spooky
Posts: 26606 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: SQL Statement Problem--Expr1000 - 2/28/2001 15:07:00
Have you tried constructing it firstly as an Access Query? its the easiest way to make sure you display all the info you need?
|
|
|
|
Guest
|
RE: SQL Statement Problem--Expr1000 - 3/2/2001 20:15:00
SELECT R.Mon,R.Yr FROM Results R WHERE (Title IS NOT NULL) Group By R.Mon,R.YrThe Group By should take care of any duplicates. Elecia
|
|
|
|
jorkel
Posts: 7 From: Kansas City, MO USA Status: offline
|
RE: SQL Statement Problem--Expr1000 - 3/2/2001 20:43:00
Spooky, I know this sounds backwards, but I don't know much about querying results directly in Access. I can do it when creating pages, but not directly through ASP.Plus, I tried the statement you gave, EliciaE, and it still didn't work. An update on this: I have created a new field for making the record go live or not. Simple radio button of Yes or No. The statement should look similar to this: SELECT DISTINCT Mon, Yr FROM Results WHERE (Live = '1') But once again only Month and Year are showing and I still need Title to show. And if I insert Title into the statement, it still doesn't work.
|
|
|
|
DavidO
Posts: 31 Joined: 10/11/2004 Status: offline
|
RE: SQL Statement Problem--Expr1000 - 10/27/2004 9:56:59
Here is an effort to make Elecia's example work in your .asp page I did not try the code but it should look something like this. <% ' set conn=server.createobject("ADODB.connection") ' connect.open "DSN=YOUR DSN" ' SQL = "SELECT R.Mon,R.Yr " &_ ' "FROM Results R " & _ ' "WHERE (Title IS NOT NULL)" &_ ' "Group By R.Mon,R.Yr" ' set rs = connect.execute(sql) %>
|
|
|
|
DavidO
Posts: 31 Joined: 10/11/2004 Status: offline
|
RE: SQL Statement Problem--Expr1000 - 10/27/2004 10:03:55
Set conn should read - set connect set conn=server.createobject("ADODB.connection") Sorry about missing this detail
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|