07-12-2022 04:16 AM - last edited on 08-11-2023 11:09 AM by JackLacava
Hello,
I created a Grid View to export data from database by SQL query. Some columns should be in number format and others in date format. I defined date format in both SQL query and in Grid View. But when I export data by right click from grid view -> Export To Excel XML, all columns are in text. How can I change default setting of XML Export so that columns will have correct formats ?
Thanks in advance.
Summer
Format in SQL Query:
FORMAT(ActiveDate, 'dd/MM/yyyy') as BuildingDate,
Format in Grid View:
ColumnName = BuildingDate, DataFormatString = dd/MM/yyyy,
Export XML file:
07-12-2022 12:38 PM
don't use the FORMAT in SQL, you can do the formatting on the gridview itself. When you use format in SQL, it converts the datatype in SQL to a text.