Format date paramer
-
- Posts: 72
- Joined: Mon Jun 07, 2010 2:39 am
Format date paramer
Hello,
Could not find somthing about this.
When define a Variable to be set as parameter and set it as datetime the formating can not be changed, which causes wrong search in database.
Will be possible to change the date formating on user interaction or reformat it in where clause in sql query - e.g like 2018-03-08 instead of 03/08/2018
Thank you.
P.S The posted value in SQL contain always datetime value instead that the format is set to date only. How can only build separately date, datetime or time
Could not find somthing about this.
When define a Variable to be set as parameter and set it as datetime the formating can not be changed, which causes wrong search in database.
Will be possible to change the date formating on user interaction or reformat it in where clause in sql query - e.g like 2018-03-08 instead of 03/08/2018
Thank you.
P.S The posted value in SQL contain always datetime value instead that the format is set to date only. How can only build separately date, datetime or time
- Attachments
-
- Screenshot from 2018-03-08 22-20-34.png (3.42 KiB) Viewed 9617 times
-
- Screenshot from 2018-03-08 22-18-13.png (24.71 KiB) Viewed 9617 times
-
- Posts: 72
- Joined: Mon Jun 07, 2010 2:39 am
Re: Format date paramer
Hello again.
Setting the variable field to string solves the problem, but we lost the datepicker which is important.
The other question is - how can we attach a date-picker to string search field and this datepicker to be configured to return a date in certain (custom) format
I use the latest version 2018.1.8
Thank you.
Kind Regards,
Tony
Setting the variable field to string solves the problem, but we lost the datepicker which is important.
The other question is - how can we attach a date-picker to string search field and this datepicker to be configured to return a date in certain (custom) format
I use the latest version 2018.1.8
Thank you.
Kind Regards,
Tony
Re: Format date paramer
Hello,
Unfortunately, it is not possible to set the custom format for DateTime variable, it depends on system culture settings.
You can use the convert function in the query.
Thank you.
Unfortunately, it is not possible to set the custom format for DateTime variable, it depends on system culture settings.
You can use the convert function in the query.
Thank you.
-
- Posts: 72
- Joined: Mon Jun 07, 2010 2:39 am
Re: Format date paramer
Alex K. wrote:
You can use the convert function in the query.
Thank you for the response. Any advice haw to implement this? The problem I see is: How to detect the datetime format of the culture, since different browsers have different language setting.
With simple words - how to get the datetime formatting of the culture in the query?
Appreciate any help on this.
Kind Regards
Tony
-
- Posts: 72
- Joined: Mon Jun 07, 2010 2:39 am
Re: Format date paramer
Setting the culture changes the display of the date in the report, but does not change the date format of the parameter for use with datepicker
I have do this into the viewer. php and designer php
but the format of date parameter does not change - it is always dd/MM/yy H:i:s
I have do this into the viewer. php and designer php
Code: Select all
<?php
$options = StiHelper::createOptions();
$options->handler = "handler.php";
$options->timeout = 30;
StiHelper::initialize($options);
?>
<script type="text/javascript">
Stimulsoft.System.Globalization.CultureInfo.currentCulture = Stimulsoft.System.Globalization.CultureInfo.cultures["bg-BG"];
Stimulsoft.Base.Localization.StiLocalization.setLocalizationFile("localization/bg.xml");
Re: Format date paramer
Hello,
Please try to use the convert to necessary format directly in the query expression. Something like:
{DateTimeVar.ToString('yyyy-MM-dd')}
Thank you.
Please try to use the convert to necessary format directly in the query expression. Something like:
{DateTimeVar.ToString('yyyy-MM-dd')}
Thank you.
-
- Posts: 72
- Joined: Mon Jun 07, 2010 2:39 am
Re: Format date paramer
Hello,
Thanks. It is working.
The correct way to write it is with double brackets like this
since the date in MySql is treated as string and we need to pass a string
Kind Regards,
Tony
Thanks. It is working.
The correct way to write it is with double brackets like this
Code: Select all
SELECT ... FROM ... WHERE .. AND OrderDate >= '{Variable4.ToString("yyyy-MM-dd")}' ....
Kind Regards,
Tony
Re: Format date paramer
Hello
We are always glad to help you!
Please let us know if you need any additional help.
Thank you.
We are always glad to help you!
Please let us know if you need any additional help.
Thank you.