How to Analyze Attributes in a Query

S

SHKNBKE

Is there a function/formula that you can use in a query against a field to
return what type of attribute the field value is?

If so, can you then change that attribute just in the query output?

Thanks.

SHKNBKE
 
J

Jerry Whittle

What do you meand by attribute? Are you talking about the data in the field?
 
S

SHKNBKE

Jerry said:
What do you meand by attribute? Are you talking about the data in the field?
Is there a function/formula that you can use in a query against a field to
return what type of attribute the field value is?
[quoted text clipped - 6 lines]
Actually I belive it would be the data type.
Thanks.
 
P

PieterLinden via AccessMonster.com

SHKNBKE said:
Is there a function/formula that you can use in a query against a field to
return what type of attribute the field value is?

If so, can you then change that attribute just in the query output?

Thanks.

SHKNBKE

You can try casting it... it might work (depends on the types you're trying
to cast from/to). There's a function for each destination type

CStr[ing] e.g. CStr(1) = "1"
CInt[eger] CInt("1") = 1
etc...

Is that what you were looking for?
 
J

Jerry Whittle

You can use the TypeName function.

Select FieldName, TypeName([FieldName])
From YourTable ;

As far as changing the data type in a query, you can use things like the
CDate and Val functions to change text to dates and numbers respectively.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


SHKNBKE said:
Jerry said:
What do you meand by attribute? Are you talking about the data in the field?
Is there a function/formula that you can use in a query against a field to
return what type of attribute the field value is?
[quoted text clipped - 6 lines]
Actually I belive it would be the data type.
Thanks.

.
 
Top