#29744 [Fbk->NoF]: DARTPART function returns random results
| From: | sniper@php.net | Date: | Sun, 20 Mar 2005 17:04:00 +0000 |
| Subject: | #29744 [Fbk->NoF]: DARTPART function returns random results | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-75580@lists.php.net to get a copy of this message | ||
ID: 29744
Updated by: sniper@php.net
Reported By: jwhatcher at hotmail dot com
-Status: Feedback
+Status: No Feedback
Bug Type: MSSQL related
Operating System: WINDOWS 2000 Advance Server
PHP Version: 5.0.0
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2005-03-07 20:25:47] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
------------------------------------------------------------------------
[2004-08-18 22:14:35] jwhatcher at hotmail dot com
Description:
------------
Using in my where clause, DATEPART (dw , dt.usedate) = 1 returns random
results toggling between SUNDAY AND MONDAY. Switch to DATENAME (dw ,
dt.usedate) = 'Sunday' and it works fine. This code worked fine in 4.2.
date_table is a table with all dates between 1900 to 2050.
Reproduce code:
---------------
$query = mssql_query(" SELECT dt.usedate FROM date_table
dt WHERE dt.usedate between '$s_reportdate' AND '$e_reportdate'
AND DATEPART (dw , dt.usedate) = 1
ORDER BY DT.usedate");
Expected result:
----------------
Should return Sunday dates between range provided.
Actual result:
--------------
Returns seemingly random results of either a Monday or Sunday date. If
I add DATEPART (dw , dt.usedate) as blah into the select clause it
returns 1 every time but the dates still shift.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29744&edit=1