cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with DateTime parameters

Former Member
0 Kudos

<p>My problem:</p><p>Crystal Reports 8.5 and MS SQL Server 2000. I create report with two parameters type DateTime - FromDate and ToDate. In Select Expert I define criteria &#39;Created&#39; (datetime field from SQL) is between {?FromDate} and {?ToDate} which is converted into formula in {?FromDate} to {?ToDate}. So far, so good.</p><p>When I now run this report with parameter values &#39;20.12.2005 00:00:00&#39; and &#39;22.12.2006 00:00:00&#39; I can see from SQL trace that query passed to SQL server is:</p><p>SELECT .... FROM ... WHERE Created Created >= "2005/12/20 00:00:00AM" AND R_Stoneridge_CountResult.Created < "2005/12/22 00:00:01PM"</p><p>Works as expexted. But now I found that on some client PCs using this report the query looks like</p><p>SELECT .... FROM ... WHERE Created Created >= "2005/12/20 00:00:00AM" AND R_Stoneridge_CountResult.Created < "2005/12/22 00:00:<strong>00</strong>PM"</p><p>and this is definitely wrong.</p><p>Can anybody suggest what can be wrong or what do I have to change in client PCs configuration</p><p>TIA</p>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

 to see how they differ from yours. Crystal uses the local regional settings for date time stuff.

    - Kathryn Webster (Report Design Consultant)Â
          Kat&#39;s News: http://diamond.businessobjects.com/blog/279


Former Member
0 Kudos

<p>This was my first thing to check also. But no luck - regional settings were the same. And from the other hand - for me it&#39;s quit hard to imagin what in regional settings can cause this kind of difference in passed query. As you can see in one (right) case 1 second is added to end time and in other (wrong) case it&#39;s not. But still Less Than is used.</p><p>And also I can&#39;t understand why Crystal uses this kind of query conversion. Why not just do it like:</p><p>Created >= FromTime and Created <strong><=</strong> ToTime</p><p>PS. It&#39;s quite big problem for me right now since I have created a LOT of reports for my customers which are using this kind queries.</p>

Answers (0)