| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| I've got a query that I use in Visual Studio. Recently, I added the "replace()" function to my SQL string, and now Visual Studio no longer pulls any records. While debugging, I can select the SQL string that returned 0 records in Visual Studio and paste that exact query into Query Analyzer (that way, I know QA is using the same date_time strings that VS is using). SQL Server 2000's Query Analyzer pulls up 7016 row(s)! In Visual Studio 2005 Professional, I fill my DataTable using the exact same string, and it returns '0' rows. Could someone enlighten me as to what I'm doing wrong? I've got several apps that use the same SQL Server, and everything else works fine. Even this query worked fine until I added the "replace()" function. Now, even if I remove the "replace()" function, the query still returns 0 rows. Here is the SQL Query: SELECT replace(TR.[OP_ID], ' ', ' ') as OP_ID, EI.[NUM], TR.[Date_Time] FROM Test_Results TR LEFT JOIN EmployeeInfo EI ON OP_ID=EI.[FIRSTNAME]+' '+EI.[LASTNAME] WHERE (TR.[System_ID] Like '%Decay%') AND (EI.[JOBTITLE]='BRZ OPRTR') AND (EI.[NUM] IS NOT NULL) AND ('7/1/2008' < TR.[Date_Time]) AND (TR.[Date_Time] < '7/31/2008') ORDER BY TR.OP_ID, TR.[Date_Time] |
![]() |
| Thread Tools | |
| Display Modes | |