0

Hi all,

I'm trying to bring up a table of data using a select query to create a DataSet that I'm displaying in a datagrid. When I use

SELECT * FROM myTable

it works fine, but when I only want the specific columns

SELECT URN, 'CanX Reason', 'Date to take effect?' FROM myTable

it doesn't.

The URNs are displaying fine but the other columns are not

    URN         Expr1001        Expr1002
    221203      CanX Reason     Date to take effect?
    224774      CanX Reason     Date to take effect?
    225311      CanX Reason     Date to take effect?
    221184      CanX Reason     Date to take effect?
    222699      CanX Reason     Date to take effect?
    223932      CanX Reason     Date to take effect?

Is there a way to correct this behaviour?

2
Contributors
2
Replies
20
Views
4 Years
Discussion Span
Last Post by Tinnin
1

You don't put single quotes around field names. Because your names have embedded blanks try putting the field names inside square brackets as in [my field name]. When you say

SELECT myfield

what gets returned is the value of myfield for all records. When you specify a literal like

SELECT 'this string'

what gets returned is the string 'this string'. It's like the difference between "print the value of x" and "print the value of 5"

Edited by Reverend Jim

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.