Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Administration & Installation

User login

Frontpage Sponsor

Main

Poll
Would you like to see a separate forum on Baanboard for the ION product?
No
14%
Yes
86%
Total votes: 80

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 20th June 2012, 11:29
frienstra frienstra is offline
Junior Member
 
Join Date: May 2010
Posts: 5
frienstra is on a distinguished road
Baan: IVc - DB: sql server - OS: windows 2003
compare long with mbst
Baan: Baan IVc4
DB: SQL Server 2008 R2
OS: Windows 2008
C/S: Both

I want to compare 2 fields. tccom001.emno which is a long field compare this with the 6 first characters of field tpppc232.desc which is a mbst.

Can somebody tell me what instruction I need to use ?

Thanks in advance.

Fons Rienstra
Reply With Quote
  #2  
Old 20th June 2012, 12:44
JaapJD's Avatar
JaapJD JaapJD is offline
Guru
 
Join Date: Sep 2002
Location: Netherlands
Posts: 473
JaapJD will become famous soon enough
Baan: BaanIV, BaanERP, ERP LN 6.1 - DB: Oracle, SQL Server - OS: Unix, Windows
Depends on wheter the tpppc232.desc field holds the number with leading zeros and is right aligned or not.

Suppose tccom001.emno is 1234.

If desc contains 1234bbSome description (b=blank) then use
Code:
if str$(tccom001.emno) = tpppc232.desc(1;6) then
If desc contains bb1234Some description (b=blank) then use
Code:
if edit$(tccom001.emno,"ZZZZZ9") = tpppc232.desc(1;6) then
If desc contains 001234Some description (b=blank) then use
Code:
if edit$(tccom001.emno,"999999") = tpppc232.desc(1;6) then
Reply With Quote
  #3  
Old 21st June 2012, 07:45
frienstra frienstra is offline
Junior Member
 
Join Date: May 2010
Posts: 5
frienstra is on a distinguished road
Baan: IVc - DB: sql server - OS: windows 2003
Hi Jaap,

Thanks for your reply. I will try your options and if I don't succeed I will come back to you.
Thanks again.
Fons
Reply With Quote
Sponsored Links
  #4  
Old 21st June 2012, 08:07
frienstra frienstra is offline
Junior Member
 
Join Date: May 2010
Posts: 5
frienstra is on a distinguished road
Baan: IVc - DB: sql server - OS: windows 2003
Hi Jaap,

I see that tpppc232.desc is left aligned, so I'm not getting any good matching.
I have following values for instance.
tccom001.emno = 230211
tpppc232.desc = "230211 " 24 blanks after 230211
I tried the same with tpppc232.cdoc which is also mbst but only 10 characters.
Can you help me out ?
I'm trying to link those two fields in a report so that i can get the value tccom001.nama (the name of the employee) on my report.
Hopefully you can help me further ?

Fons
Reply With Quote
  #5  
Old 21st June 2012, 08:26
JaapJD's Avatar
JaapJD JaapJD is offline
Guru
 
Join Date: Sep 2002
Location: Netherlands
Posts: 473
JaapJD will become famous soon enough
Baan: BaanIV, BaanERP, ERP LN 6.1 - DB: Oracle, SQL Server - OS: Unix, Windows
If I understand correctly you want to read the employee name based on tpppc232.desc. In that case you can write a query like this:
Code:
select tccom001.nama
from tccom001
where tccom001.emno = :1
as set with 1 rows
wherebind (1, lval(tpppc232.desc(1;6))
selectdo
   ....
endselect
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
compare long with mbst frienstra Blogs and Web links 0 20th June 2012 11:26
Date casting issue niralibaan Tools Development 2 22nd August 2010 18:26
Help regarding tools session rahul.kolhe22 Tools Development 4 22nd January 2010 13:31
Undocumented Functions & Variables george7a Tools Development 79 3rd August 2009 09:58
xml question steveauckly Tools Development 4 27th July 2004 10:41


All times are GMT +2. The time now is 18:54.


©2001-2013 - Baanboard.com - Baanforums.com