Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All
I am a new user and I need your help for a rather easy ( for you ) problem.
I want to separate date from time.
In the past I was doing something like this :
Date (DateTime,'dd/mm/yyyy') As ShortDate
But now I can't find the date function. I am using the Version 9.00.7469.8 SR4.
Thank you very much
Kostas Stathis ( k.stathis@live.com )
Hi Kostas,
You can try the below. If you can send some examples of App_Date field from your SQL database, we can guide you better.
makedate(year(App_Date), month(App_Date), day(App_Date)) as ShortDate
Regards,
Sajeevan
Hi,
Date function is there in version 9.
Have a look at the help file.
And its the only function to get the date out of a time stamp.
Regards,
Kaushik Solanki
Hi Kostas,
Please try this....
Date#(Date (DateTime,'dd/mm/yyyy') )As ShortDate
Regards,
Antony.
Dear Kaushik
Below you can see the error message. The date function exists in the help file
I am recieving data from an access 2007 database. I will try to use the same from SQL 2008 Sample DB.
Thank you for your instant response.
SQL Error:[Microsoft][ODBC Microsoft Access Driver] Wrong number of arguments used with function in query expression 'Date(App_Date,'dd/mm/yyyy''.
SQL Scriptline:
SQL State:37000
SQL SELECT
App_Date,
Date(App_Date,'dd/mm/yyyy') As ShortDate,
App_ID,
App_Notes,
App_Time,
ContactName,
EstCost,
FinCost,
Job,
Status
FROM Appointment
Hi,
Yes, the reason is sql date function takes only 1 parameter, where as qlikview date takes 2 parameter.
Try below code.
load *, Date(App_Date,'dd/mm/yyyy') As ShortDate;
SQL SELECT
App_Date,
App_ID,
App_Notes,
App_Time,
ContactName,
EstCost,
FinCost,
Job,
Status
FROM Appointment
Regards,
Kaushik Solanki
Dear Antony
I have done this yesterday. The result is very strange. I am loosing the month.
I am expecting 11/07/2011 and the result is 11/00/2011 !!!
The Day and the Year are always correct but the month is always 00.
Regards Kostas
Hi,
Please send your application......
I have just tried it. There is no error message BUT the result was 11/00/2011 the month is 00.
This the new script. I will spend some more time trying to find out what goes wrong. Unfortunately I have all the time in the world.
LOAD
App_Date,
Date(App_Date,'dd/mm/yyyy') As ShortDate,
App_ID,
App_Notes,
App_Time,
ContactName,
EstCost,
FinCost,
Job,
Status;
SQL SELECT App_Date,App_ID,App_Notes,App_Time,ContactName,EstCost,FinCost,Job,Status
From Appointment;
Thank you very much
Kostas
Antony you can find posted ( as an answer to Kaushik ) the script.
Thanks
Kostas
HI,
Make sure that the data is in proper way in your database.
Regards,
Kaushik Solanki