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!

Testing data types 2

Status
Not open for further replies.

lashwarj

IS-IT--Management
Nov 1, 2000
1,067
US
I am recievine a data type missmatch on a remote view database, the view and the table have the same exact data formats, is there a way to test data types with code.

Ex. You can get the character count with LENC() do they have one that returns the Type = Char(30)
 
Look at type() or vartype() in the help or Hackers Guide.
 
Also look at the AFIELDS() function it will given you "ALL" the available information.

Rick
 
ok, weird, I have used the TYPE() function and it returns N for fields where the value for the physical is Char and the variable has not been set.
 
When using TYPE(), you need to surround the variable with qoutes. Say field F1 contains char '1234'. TYPE(F1) can get evaluated to a numeric value 1234. When using VARTYPPE(), the opposite is true. If you surround the variable or memvar with quotes; VARTYPE("F1"), it will always return "C" because it looks at the value in parentheses and thinks it is of type character. To determine the type with VARTYPE(), use just the variabe or field name: VARTYPE(F1).
Dave S.
[cheers]
 
Gee whiz. A lot of typose there. Sorry. I took my mittens off now so I should be able to type better.

When using TYPE(), you need to surround the variable with quotes. Say field F1 contains char '1234'. TYPE(F1) can get evaluated to a numeric value 1234. When using VARTYPE(), the opposite is true. If you surround the variable or memvar with quotes; VARTYPE("F1"), it will always return "C" because it looks at the value in parentheses and thinks it is of type character. To determine the type with VARTYPE(), use just the variabe or field name: VARTYPE(F1).
Dave S.
[cheers]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top