Weird Error Message

  • Thread starter Thread starter Anthony
  • Start date Start date
A

Anthony

I keep getting this error:

ORDER BY clause ([ServiceYear]) conflicts with DISTINCT.


when this line tries to execute:

cboYear.RowSource = "SELECT DISTINCT [Service Year] FROM
ServiceDetails WHERE [ServiceCode] = 'ABC' ORDER BY [ServiceYear] DESC "


What am I doing wrong?
 
hi Anthony,
I keep getting this error:
ORDER BY clause ([ServiceYear]) conflicts with DISTINCT.
when this line tries to execute:
cboYear.RowSource = "SELECT DISTINCT [Service Year] FROM
ServiceDetails WHERE [ServiceCode] = 'ABC' ORDER BY [ServiceYear] DESC "
What am I doing wrong?
Typo in the select list there is a space in the field name.


mfG
--> stefan <--
 
No, that's not the problem because the field name has square brackets
([Field Name]) around it.

This, however, would be invalid:

(Field Name)

But this, would not:

([Field Name])
Stefan Hoffmann said:
hi Anthony,
I keep getting this error:
ORDER BY clause ([ServiceYear]) conflicts with DISTINCT.
when this line tries to execute:
cboYear.RowSource = "SELECT DISTINCT [Service Year] FROM
ServiceDetails WHERE [ServiceCode] = 'ABC' ORDER BY [ServiceYear] DESC "
What am I doing wrong?
Typo in the select list there is a space in the field name.


mfG
--> stefan <--
 
oh, never mind - you are correct.
Stefan Hoffmann said:
hi Anthony,
I keep getting this error:
ORDER BY clause ([ServiceYear]) conflicts with DISTINCT.
when this line tries to execute:
cboYear.RowSource = "SELECT DISTINCT [Service Year] FROM
ServiceDetails WHERE [ServiceCode] = 'ABC' ORDER BY [ServiceYear] DESC "
What am I doing wrong?
Typo in the select list there is a space in the field name.


mfG
--> stefan <--
 
thanks, Klatuu, that is correct
Klatuu said:
It appears to be a typo. You have it as [ServiceYear] in one place and
[Service Year] in another.
--
Dave Hargis, Microsoft Access MVP


Anthony said:
I keep getting this error:

ORDER BY clause ([ServiceYear]) conflicts with DISTINCT.


when this line tries to execute:

cboYear.RowSource = "SELECT DISTINCT [Service Year] FROM
ServiceDetails WHERE [ServiceCode] = 'ABC' ORDER BY [ServiceYear] DESC "


What am I doing wrong?
 
Back
Top