HomeForum
Welcome, Guest

Loading float data into integer field
(1 viewing) (1) Guest
Data Warehousing and Data integration
  • Page:
  • 1
  • 2

TOPIC: Loading float data into integer field

Loading float data into integer field 10 months ago #3283

  • RAMESH
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
  • Karma: 0
I need the DateAdd and the DateDiff calculations (as they are in Excel or Access) in order to some calculations on the data to load them into a database.

Also, how would load a float value in the csv file into an column whose type is Integer. I want to either truncate or round the float to an integer.

Thanks.

Re: Loading float data into integer field 10 months ago #3284

  • admin
  • OFFLINE
  • Moderator
  • Posts: 2183
  • Karma: 12
Remaesh

Documentation page 110:

IncDateS

IncDateS(Date,Format,ChangeType,Increment):String.

ChangeType: YEAR,MONTH,WEEK,DAY,HOUR,MINUTE,SECOND

Use IncDateS to Increase ChangeType part of a date value by an Increment.

IncDateS ('01012003','DDMMYYYY', 'YEAR',1)

DecDateS

DecDateS(Date,Format,ChangeType,Decrement):String.

ChangeType: YEAR,MONTH,WEEK,DAY,HOUR,MINUTE,SECOND

Use DecDateS to Decrease ChangeType part of a date value by an Decrement.

DecDateS ('01012003','DDMMYYYY', 'YEAR',1)

DateDiffS

DateDiffS (Date1,Format1, Date2,Format2,Type):String.

Type: YEAR,MONTH,WEEK,DAY,HOUR,MINUTE,SECOND

Use DateDiffS to calculate Type difference between two dates.

DateDiffS ('01012003','DDMMYYYY', '01012000','DDMMYYYY', 'YEAR')

Mike

Re: Loading float data into integer field 10 months ago #3285

  • admin
  • OFFLINE
  • Moderator
  • Posts: 2183
  • Karma: 12
lso, how would load a float value in the csv file into an column whose type is Integer. I want to either truncate or round the float to an integer.

Documentation page 107

Round
Round(Float,Integer):Float
Use Round to round Value to a specified power of ten.
The following examples illustrate the use of Round:
Expression Value
Round(1234567, 3) 1234000
Round(1.234, -2) 1.23
Round(1.235, -2) 1.24
Round(1.245, -2) 1.24

Mike

Re: Loading float data into integer field 10 months ago #3286

  • RAMESH
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
  • Karma: 0
But doesn't the Round() function return a Float value?

How would I use Round() in these cases:

1) 2.0 should give me 2
2) 20034.0 should give me 20034
3) 34.0 should give me 34

Should I use Round(number,0)? Can I map this to a field whose type is Integer?

Thanks.

Re: Loading float data into integer field 10 months ago #3287

  • admin
  • OFFLINE
  • Moderator
  • Posts: 2183
  • Karma: 12
Ramesh

If your data all like this I do not think you need any additional functions it should work without it

Mike

Re: Loading float data into integer field 10 months ago #3288

  • RAMESH
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
  • Karma: 0
Here is the screen shot od the error when trying to load float values into a field of type Integer:
Attachments:
  • Page:
  • 1
  • 2
Time to create page: 0.20 seconds

Testimonials

"DBSL software is important part of core business processes and has enabled us to scale up our capacity."

Tim Matter
CRM Team manager,

User Login

You only need to log in or register to use our support forum



Our customers

BP

BBC

HSBC


Databases we work with

Go to top