SQL "Select" problem

scouseman
01-08-2004, 12:50 PM
Hi

I wonder if some one can help me I have connected to a database (mdb) using ado but I cannot workout the select statement which opens the right part of the database.

How do I select a field called "order" which is inside a record called "alert"

Thanks for any help

Scouse

00100b
01-08-2004, 12:52 PM
Order is a keyword used in the Order By clause. To specify that the name of the field provided in the select statement is to be evaluated as the field and not the keyword, wrap the field name in brackets.

SELECT [order] FROM alert

scouseman
01-08-2004, 01:16 PM
Hi 00100b

Thanks for your reply it was the sqaure brackets that got me. One other thing is there any way to just display 1 column from the field in my database as there are over 50 columns and apart from the actual size I would need to manually enter all the headings

Thanks for you time and help

Scouse

Dennis DVR
01-08-2004, 01:30 PM
Hi 00100b

Thanks for your reply it was the sqaure brackets that got me. One other thing is there any way to just display 1 column from the field in my database as there are over 50 columns and apart from the actual size I would need to manually enter all the headings

Thanks for you time and help

Scouse

what do you mean?
if you want to display only one field just select the field that you want to display SELECT Field1 FROM Table

scouseman
01-08-2004, 01:41 PM
I think I got a bit messed up with the database terminology, know wonder I cannot get my select statement to work, let me try to explain a bit better:

I have the database file which has 15 records in the root one of those records is called "Alert", inside "Alert" there are 5 tables 1 of which is called "order", order has 52 fields one of which is called "ID" which is what I need to display.

Thanks and sorry for the confusion, I hope this explains things better.

Scouse;)

Dennis DVR
01-08-2004, 01:45 PM
I think I got a bit messed up with the database terminology, know wonder I cannot get my select statement to work, let me try to explain a bit better:

I have the database file which has 15 records in the root one of those records is called "Alert", inside "Alert" there are 5 tables 1 of which is called "order", order has 52 fields one of which is called "ID" which is what I need to display.

Thanks and sorry for the confusion, I hope this explains things better.

Scouse;)

SELECT [ID] FROM [Order]

scouseman
01-08-2004, 02:01 PM
Thanks

I have now finally work it out, I must be very slow today

Thanks for you patience

Scouseman

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum