Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date

I have a field from the database that has the format datetime-

And i neeed only to show in the report the date part. How can i do??

only: dd/mm/yyyy

Thanks.

6 Replies
Not applicable
Author

Try to format field

date

(Fieldname,format)



Example

date

(Field,'DD/MM/YYYY') or date(Field,'MM/DD/YYYY')

Best regards



Not applicable
Author

Hi,

Using date(DOB,'DD/MM/YYY'),date#(DOB,'DD/MM/YYYY')..Like so many functions are available in Qlikview. Just go through reference manual u can find so many functions with examples.

Regards,

Ravi....

Not applicable
Author

Hi Txetxu

There are a lot of functions that are available for extracting the date alone from a time stamp. The best methode is to use the date and time functions which is given in the reference manual under the topic 'Date and Time Functions'. This might help.

Even if you cant extract the date then there are functions called left() right() and mid() which is also explained in the reference manual.

For example if the date format is like this: 1/21/2010 00:30:15 then, if you use the "date#(Field name,'Format') as Date" in the script part, then you will get the solution. Otherwise you can also use left function like "left(FieldName,10)" which gets the first 10 characters from the left and store it in the new Date field.

Hope this helps you solve the issue.

Best Regards

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

If your database field is coming in as a "Date" field (with the numeric part and the formatted test part), and you don't need the time portion, I'd recommend rounding the number down and then formatting the date, like this:

date(floor(MyTimestamp), 'DD/MM/YYYY')

If, however, your timestamp is coming in as a string, you need to convert it to a date field and then format. Function date# is used to convert a string to a date based on a certain formatting pattern:

date#(MyTimeStamp, 'DD/MM/YYYY hh:mm:ss')

Once you have a proper date field, you can, once again, round the number down and format the field as we did before.

cheers,

Not applicable
Author

i have test all your posibilities but i never view the correct results.

now in the table i have format the field and it finished with this format DD/MM/YYYY

but when it is reload in the it appers at DD/MM/YYYY

how can i do????

i need this field to select it with a macro a i can´t select one!!!! i don´t know what to do!!

Thanks.

Not applicable
Author

Hi txetxu18,

can you post your script, what you have written for format the date in chart or script.

The basic things should work.

Regards,

Ravi....