HomeForum
Welcome, Guest

Replacind Date with null
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Replacind Date with null

Replacind Date with null 10 months ago #3377

  • Joe
  • OFFLINE
  • Junior Boarder
  • Posts: 33
  • Karma: 0
Hello,

I'm trying to do a simple test and replace for a date on an ODBC data source (Foxpro) and output to a MS SQL Server table. There are some dates in the source file of 30/12/1899 which I would like to replace with null values on the output.

Nothing appears to be working for me and I get blanks in the output each time. However, when I ask for a "Data Preview" I get the correct results (see attached).

When I use a "Mapped to" I get the correct results on the output. But if I leave the calculated field formula in, I get nothing in the output (ie - I have to physically delete the calculation for the mapped field to work.

I must be missing something in the coding....please let me know what I should be using for this....thanks

I've also tried:

Iif(RightString([PROSDATE],4)=='1899','',[PROSDATE]) which gives the same results as the Date and DateS functions.


No Output:

Iif(YearS([PROSDATE],'DD/MM/YYYY')=='1899','',[PROSDATE])

Iif(YearS([PROSDATE],'DD/MM/YYYY')=='1899','01/01/2010',[PROSDATE])

YearS([PROSDATE],'DD/MM/YYYY')


Works OK:

YearS('30/12/2009','DD/MM/YYYY')

Thanks,
Joe

Re: Replacind Date with null 10 months ago #3378

  • admin
  • OFFLINE
  • Moderator
  • Posts: 2191
  • Karma: 12
Can you try this one please

Iif(YearS([PROSDATE],'DD/MM/YYYY')=='1899','',[PROSDATE])

Mike
  • Page:
  • 1
Time to create page: 0.15 seconds

Testimonials

“DBSL has proved to be a robust and versatile solution that we continue to integrate with different aspects of our business.”

Bob Carter,
IT Consultant

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