Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forcing a field to a data type in a query

Status
Not open for further replies.

Stevehewitt

IS-IT--Management
Jun 7, 2001
2,075
GB
Hi All,

I'm using a MS created DB - and the data structure is all over the shop.

I have created a field in a query using the following:

Code:
PriKey: [LastName] & "," & [FirstName]

This works fine, and produces the results OK.

However I need to used the resulting data in a subreport. The join is between a field on another table, where the records have the same value.

No problem so far.

The tricky part, is that the field I want to join to, even though it's just got text (such as "Doe, Smith") it's set as a numeric data type.

When I try my subreport join Access tells me that the data types do not match.

Essentially I want to force the field that have created in the query (see above code) to run as a numeric data type.

Anyone help me out?

I've tried setting the properties for the field to numeric but no joy.

Cheers,




Steve.

"They have the internet on computers now!" - Homer Simpson
 
Numerics can't store letters ... 0-9 only. The only way I can see to do it would be to convert each letter to its Asc value and then concatenate them. Not pretty and you would probably blow up on an overflow for even moderate length strings.

What sort of database is it that has this stuff in a numeric field?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top