1

I have a simply but fror me unsolveable question

I have this request:

Firebird Select Field From Table where Field = current_date

The problem is that this field is a text field an holds date in this format: 25.04.2014

How can i convert it that this questions works if it is the current date.

Michael Müller
  • 371
  • 6
  • 23

1 Answers1

4
SELECT fields FROM table WHERE field=
  substring(100+extract(day from current_date) from 2 for 2)
  || '.' ||
  substring(100+extract(month from current_date) from 2 for 2)
  || '.' ||
  extract(year from current_date)
Eugen Rieck
  • 64,175
  • 10
  • 70
  • 92