Solved

SQL weird

Posted on 2006-11-22
10
167 Views
Last Modified: 2010-04-30
SELECT DISTINCT fldHistoSItemsDate, fldHistoSItemsHeure, fldHistoSItemsEmp
FROM         [Histo - SItems]
WHERE     (fldHistoSItemsSaisie = 144)
ORDER BY fldHistoSItemsDate, fldHistoSItemsHeure



This request returns me 4 result in VB6 but 1300 in SQL Manager... any idea ? not the same format but same value.
0
Comment
Question by:TheSonics
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 35

Accepted Solution

by:
Raynard7 earned 168 total points
ID: 17999997
In vb I would get it to output the exact query that is being run, then copy that to sql manager and try it.

You may need to address the specific database, also the distinct keyword may be causing you problems.  It should however be behaving the same if the exact same query is sent to it.
0
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 166 total points
ID: 18001083
can you show us the relevant VB code?
what is the table structure?


like Raynard indicates, the issue might the distinct with the datetime fields, which due to different formatting, might do different results.
you might then have to apply the convert() function around them to force the same output, like:

SELECT DISTINCT convert(varchar(10), fldHistoSItemsDate, 120) as fldHistoSItemsDate#
, convert(varchar(10), fldHistoSItemsHeure, 8) as fldHistoSItemsHeure , fldHistoSItemsEmp
FROM         [Histo - SItems]
WHERE     (fldHistoSItemsSaisie = 144)
ORDER BY 1, 2
0
 
LVL 9

Assisted Solution

by:Naveen Swamy
Naveen Swamy earned 166 total points
ID: 18001309
angelIII  is right,
 also use trace/profiler to check for any errors,
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 17

Expert Comment

by:inthedark
ID: 18006818
What is the data type of fldHistoSItemsSaisie?
0
 
LVL 35

Expert Comment

by:Raynard7
ID: 18074691
I think that you should ask to have your grade re-marked, if none of these solutions gave you your answer then you should have indicated as such - C's should only rarely / if ever be given - read the help files if you are unsure

Additionally since navstar's answer was just agreeing with AngelIII's answer he should be given some of the credit.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 18372701
point split Raynard, angelIII, navstar16
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month7 days, 17 hours left to enroll

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question