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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looking for a formula to change field type

Status
Not open for further replies.

IAmKarl

Instructor
Dec 13, 2002
25
US
I have a field in a database i am trying to use in crystal that is full of IP addresses in the form of N.N.N.N where n = integer between 1 and 255, crystal keeps wanting to read that field as currency, and thereby only looks at the N.N part of the field as opposed to all four number blocks, is there a way i can use a formula to make this display as the whole field, treating it like a string, as opposed to currency? or a simple way to tell crystal to look at it as a string?

Thanks,
Karl P
 
What kind of database?

It's very odd that Crystal would alter the data type.

You might use a SQL Expression to CAST it as a char or varchar if it's a SQL database.

Please provide an example of what's in the field? For instance, does each field contain multiple IP's, or each field contains one IP.

-k
 
I am pulling data from a txt file that is comma delimited, it is a log file in the format of
---
Date/time, Port Number, Ip Address, DNS Address, Direction, Ip Address, DNS Address, User, Auth Code
---
all on one line, one line per transaction - tens of thousands of lines

so, an example example might be as follows

1/4/2003, 80/www, 14.123.232.98, machine-15.somehost.com, Outgoing, 85.42.195.23, Usr236592, 44kfjel6

now crystal sees this whole file perfectly, and it is working as desired from this file, with the exception of it sees the ip addresses, in the form of *for instance* 14.123.232.98 (although those numbers can be anywhere between 1 and 255), for some reason its calling this field a currency, and it will only show the first and second number set out of the 4, so for instance, it sees that as 14.123 - and its ignoring the data following it, and i need a way to tell crystal to stop treating the field as a currency and display it as a string, whether theres a trick to do it, or if i have to run the whole field through a formula, there is only one ip address per field, and let me stress that crystal is reading this whole file correctly and is treating all the different fields correctly.

Karl P
 
correction there is date AND time in the Date/Time field - correction would look like this
---
1/4/2003 15:02:10, 80/www, 14.123.232.98, machine-15.somehost.com, Outgoing, 85.42.195.23, Usr236592, 44kfjel6
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top