Baanboard.com

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

User login

Frontpage Sponsor

Main

Google search


Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
38%
Installation Wizard into new VRC
38%
Manual into existing VRC
5%
Manual into new VRC
19%
Total votes: 42

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 30th December 2017, 05:22
gmmisdt gmmisdt is offline
Junior Member
 
Join Date: Oct 2017
Posts: 3
gmmisdt is on a distinguished road
Baan: 12.6 - DB: sql - OS: windows
QLState 42I03: Unknown column 'val' (error 302)
Baan: Other/Unknown
C/S: None/Unknown

Hi,
I use tcibd001.exin field as per my reuirement and when m going to compare this field with another table in which field's datatype is double and tcibd001.exin is string now while comparing its give error as attached.

FInd attached my query below.
|******************************************************************************
|* tdsls4401mc02 0 VRC B61O a live
|*
|* VJJI
|* 2017-12-28
|******************************************************************************
|* Main table tdsls401 Sales Order Lines, Form Type 4
|******************************************************************************

|****************************** declaration section ***************************
declaration:

table ttdsls401 | Sales Order Lines
table ttcibd001
table ttdtrg190
extern domain tcqsl1 back.qty

|****************************** program section ********************************


|****************************** group section **********************************

group.1:
init.group:
get.screen.defaults()

|****************************** choice section ********************************

choice.cont.process:
on.choice:
execute(print.data)

choice.print.data:
on.choice:
if rprt_open() then
read.main.table()
rprt_close()
else
choice.again()
endif


|****************************** field section *********************************

field.orno.f:




|****************************** function section ******************************

functions:

function read.main.table()
{


select tcibd001.exin,sum(tdsls401.qbbo):back.qty,tdtrg190.prmx
from tdsls401,tcibd001,tdtrg190
where tdsls401.item = tcibd001.item and tdsls401.qbbo > 0 and tcibd001.exin <> "" and val(tcibd001.exin) >= tdtrg190.cpfm and sval(tcibd001.exin) <= tdtrg190.cpto
group by tcibd001.exin,tdtrg190.prmx
selectdo
rprt_send()
endselect
}


Regards,
Vishal
Attached Images
File Type: png Untitled.png (85.2 KB, 12 views)
Reply With Quote
Sponsored Links
  #2  
Old 2nd January 2018, 14:38
JaapJD's Avatar
JaapJD JaapJD is offline
Guru
 
Join Date: Sep 2002
Location: Netherlands
Posts: 755
JaapJD will become famous soon enoughJaapJD will become famous soon enough
Baan: BaanIV, BaanERP, ERP LN 6.1 - DB: Oracle, SQL Server - OS: Unix, Windows
You should not use the val() function but the SQL CAST expression. See the Programmer's Manual.
Reply With Quote
  #3  
Old 3rd January 2018, 07:06
pralash pralash is offline
Senior Member
 
Join Date: Feb 2017
Posts: 203
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
Hi,
You may be use the Lval function for converting string to long as per your requirement....

Syntax:
function long lval (string value)

Description

This function performs explicit string to long type conversion.

Regards,
Pralash
Reply With Quote
  #4  
Old 4th January 2018, 04:29
gmmisdt gmmisdt is offline
Junior Member
 
Join Date: Oct 2017
Posts: 3
gmmisdt is on a distinguished road
Baan: 12.6 - DB: sql - OS: windows
Hi,
I try val() and lval() too but its not working.
I found on internet that this function not work in report script..?
is it true?
Need to find other way for this.


Regards,
Vishal
Reply With Quote
  #5  
Old 4th January 2018, 07:34
pralash pralash is offline
Senior Member
 
Join Date: Feb 2017
Posts: 203
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
Hi,

1. Declare a double variable and assign the value of the string variable to it using val() function

e.g.
Code:
domain tcamnt amnt_val
string amnt_str

amnt_str = "182.22"
if not isspace(amnt_str) then
amnt_val = val(amnt_str)
else
amnt_val = 0
endif

2. On your report layout, use val(amnt_str) and use domain like tc amnt
Reply With Quote
  #6  
Old 4th January 2018, 11:15
JaapJD's Avatar
JaapJD JaapJD is offline
Guru
 
Join Date: Sep 2002
Location: Netherlands
Posts: 755
JaapJD will become famous soon enoughJaapJD will become famous soon enough
Baan: BaanIV, BaanERP, ERP LN 6.1 - DB: Oracle, SQL Server - OS: Unix, Windows
val() and lval() do work in report script, but not in SQL queries. Try my suggestion with the CAST expression.
Reply With Quote
  #7  
Old 8th January 2018, 04:43
gmmisdt gmmisdt is offline
Junior Member
 
Join Date: Oct 2017
Posts: 3
gmmisdt is on a distinguished road
Baan: 12.6 - DB: sql - OS: windows
Hi,
Its working using CAST.
Thnks guys.

Regards,
Vishal
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
Unknown Column (Error 302) raghuvirk20 Tools Development 7 3rd January 2017 12:32
Unknown column errror in report script heidihunter Tools Development 3 14th August 2003 14:04


All times are GMT +2. The time now is 17:25.


©2001-2017 - Baanboard.com - Baanforums.com