Hi everyone,
I have a table, let's say
child(name varchar(50) primary key,
birth_date date not null)
and some data
and i want to make a query to show wich is the birth_date of the older child in de db. So i make a qwery with an aggregate function like this
min(birth_date)
but, instead of showing a date, the query shows a number.
How can i transform this number into a date?
Thanks
carles
[Solved] Queries and dates
[Solved] Queries and dates
Last edited by carles on Wed Apr 30, 2008 10:01 am, edited 1 time in total.
Re: queries and dates
First I thought you found a way to convert dates to numbers which could open some options to calculate with day-offsets ("BirthDate"-99), but CAST(MAX("Date") AS DATE) raises an error that Java can not convert "yyyy-mm-dd" to number ... just like CAST(39536 AS DATE).
Anyway, the displayed number is a date, which seems to be converted to number by the Base frontend. Save your query, close, re-open, change the number format for each column and save (seems to fail when done in a single step).
Anyway, the displayed number is a date, which seems to be converted to number by the Base frontend. Save your query, close, re-open, change the number format for each column and save (seems to fail when done in a single step).
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: queries and dates
Ok! That works. By the way, you can do it in one step if you write the query, execute it without saving, and then change the format of the colum with the number to a date format. Then you can save it.
Thanks
carles
Thanks
carles