Convert data type in Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am working with data in a Table that is read only - I cannot change the
data type. There is a Memo field that I need to query and would like to use
the Unique Value property. Can I change the data type of this field to Text
using a function in the query? I realize I may lose some of the data, but
this would still be more useful than the many duplicates I'm getting now.

Thanks, Mary
 
You can use a calculated column that returns the first 255 characters.

Field: ShortenIt: LEFT([TheMemoTable].[TheMemoField],255)

This will be slow since there is no index available to help the query determine
the duplicate values so it will have to be done using a table scan.
 
Thanks - that's exactly what I needed!

John Spencer (MVP) said:
You can use a calculated column that returns the first 255 characters.

Field: ShortenIt: LEFT([TheMemoTable].[TheMemoField],255)

This will be slow since there is no index available to help the query determine
the duplicate values so it will have to be done using a table scan.
I am working with data in a Table that is read only - I cannot change the
data type. There is a Memo field that I need to query and would like to use
the Unique Value property. Can I change the data type of this field to Text
using a function in the query? I realize I may lose some of the data, but
this would still be more useful than the many duplicates I'm getting now.

Thanks, Mary
 
Back
Top