Text field in a group by, how can I make it work?



Hi,
I need to do a sum this way : Select Field1, Sum(Field2) as sumField2 From
Table1 Group By Field1. I think the syntax is correct, but the problem is
that Field1 is of type Text (and not varchar). So I receive an error telling
me I can't "group by" with a field of type "Text". Is there a way I can
convert this field into something else directly in the query so the query
works?

Thanks

ThunderMusic

btw, I'm in SQL Server 2000


.



Relevant Pages

  • Replace-Function with Sybase?
    ... as varchar. ... the attribute I need to query for is a string with 30 Digits. ... " Incorrect syntax near the keyword 'REPLACE'. ...
    (comp.databases.sybase)
  • select if(...) from
    ... is it possible, with Ingres II, to write such a query: ... select field1, iffrom table ... where the syntax would be if? ...
    (comp.databases.ingres)
  • Re: Is it possible to link two text boxes...
    ... The only thing I can think of would be to divide the text in the query. ... SELECT MyTextField AS Field1, MyTextField AS Field2 ... question is that I have two images on the page and one is justified left ...
    (microsoft.public.access.reports)
  • Re: Append import data to existing record
    ... (I'm sure I need to exchange Field1 with my actual field name but what about ... > or query with values from a non-updatable table or query - even though ... > in the text file - is to write VBA code that uses recordset operations ... > to read the data from the text file and update the subform table. ...
    (microsoft.public.access.externaldata)
  • Re: Group By, Max and Min
    ... SELECT field1, field2, field3, LAST, MIN, MAX ... I have (from a previous saved query) these fields: ...
    (microsoft.public.access.queries)