Skip to main content
Question

How to compare date field to system date; omit records with dates "less than" today's date?

  • January 27, 2015
  • 3 replies
  • 89 views

I have a few tables that I am converting from Oracle Spatial to Google Maps Engine (GME) tables. There is a field, called "DISCONTINUEDATE", which has the end dates for certain projects. Rather than delete the records whose DISCONTINUEDATE's are prior to today, I'd like to omit them from the data being published with GME.

 

 

So far I'm using the TimeStamper transformer to create a "SYSDATE" field with today's date. I'm having trouble using a Tester to compare the new value with DISCONTINUEDATE in order to omit certain records. The SYSDATE field is created as a String value so I can't figure out how to compare the two. Ideally, I would like all records with a DISCONTINUEDATE "<" SYSDATE omitted but I'm not sure how to do this.

 

 

Anyone had success doing this before?
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

fmelizard
Safer
Forum|alt.badge.img+21
  • Safer
  • January 28, 2015
Hi,

 

Have you tried formatting the date(s) with the DateFormatter or DateConverter?

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • January 28, 2015
Yes, or for full control you can use tcl date

 

 

@Evaluate([clock format [clock scan "@Value(DISCONTINUEDATE)"] -format "%Y%m%d"]) - @Evaluate([clock scan "@Value(SYSDATE)"])

 

 

Format as your needs dictate of course..

 

 

 

see

 

 

http://www.tcl.tk/man/tcl8.4/TclCmd/clock.htm

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • January 28, 2015
That piece was from a workspace...

 

to substract them should be without the formatting..:

 

=@Evaluate([clock scan "@Value(DISCONTINUEDATE)"]) - @Evaluate([clock scan "@Value(SYSDATE)"])

 

You can insert the string in a tester and test for regexp <0 like this