Solved

SQL weird

Posted on 2006-11-22
10
166 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
Independent Software Vendors: 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!

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

734 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