If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Pervasive.SQL > Sales_history_detail.number

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-21-09, 19:41
edusilva edusilva is offline
Registered User
 
Join Date: May 2009
Posts: 4
Sales_history_detail.number

Hello, I'm trying to build a query accessing Sage Business Vision database.
In the help file it says that NUMBER (the number of the invoice) is a 10 character String.
When I do some query in Pervasive SQL Data Manager, SALES_HISTORY_DETAIL.NUMBER returns data like this:
0000162330
However for a query like this:
Code:
SELECT "SALES_HISTORY_DETAIL"."NUMBER", "SALES_HISTORY_DETAIL"."CODE"
FROM "SALES_HISTORY_DETAIL"
WHERE "SALES_HISTORY_DETAIL"."NUMBER" = 0000162330
I don't get any results unless I change the 'where' clause to this:
WHERE "SALES_HISTORY_DETAIL"."NUMBER" LIKE '%162330'
All this variations fail
WHERE "SALES_HISTORY_DETAIL"."NUMBER" = '0000162330'
WHERE "SALES_HISTORY_DETAIL"."NUMBER" = '162330'
WHERE "SALES_HISTORY_DETAIL"."NUMBER" = 162330
Why can't I just use the '=' operator?

Thanks,
Eduardo
Reply With Quote
  #2 (permalink)  
Old 10-21-09, 20:42
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
If NUMBER is a string, then you have to treat it as a string. The proper way to do it would be:
Code:
WHERE "SALES_HISTORY_DETAIL"."NUMBER" = '0000162330'
You said that this fails. What do you mean? Is it returning an error or just not returning results? If it's an error, what error. If it's no results, then it's possible that what's actually in the file is different. I would suggest contacting Sage Business Vision to find out how they are putting the value into the field so you can send in the proper formatted value.
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
  #3 (permalink)  
Old 10-22-09, 11:07
edusilva edusilva is offline
Registered User
 
Join Date: May 2009
Posts: 4
Thank you, Mirtheil.
When I said fail, I meant that it returned nothing, but didn't give me any error.
Only with the "Like" operator am I successful to get the right data returned.
I will look for help in sage's forum

Eduardo
www.expresssignproducts.com
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On