Baanboard.com

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

User login

Frontpage Sponsor

Main

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

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 9th February 2004, 20:41
ltannous's Avatar
ltannous ltannous is offline
Senior Member
 
Join Date: Sep 2002
Location: Canada
Posts: 280
ltannous is on a distinguished road
Baan: 4c4 - DB: Oracle - OS: UNIX
select statement in script option

How can I select 2 variables
eg

select tibom010.*
from tibom010
where tibom010.exdt > DATE.NUM()
or tibom010.exdt = 0
selectdo

When I use the "or" I get a execution error, but it compiles ok.
We need the 0 or blank option because most of the BOM lines have no expiry date while some have future exipry dates.
Reply With Quote
  #2  
Old 9th February 2004, 20:51
evesely's Avatar
evesely evesely is offline
Guru
 
Join Date: Dec 2001
Location: Lisle, Illinois USA
Posts: 411
evesely is on a distinguished road
date.num() issue

My experience has been that date.num() should not be used directly in a WHERE clause. You can either assign it to a variable outside of the SELECT statement or use a WHEREBIND. An example of the first method is:

Code:
domain	tcdate	date.use

date.use = date.num()
select	tibom010.*
from	tibom010
where	tibom010.exdt > :date.use
or	tibom010.exdt = 0
selectdo
...
endselect
Reply With Quote
  #3  
Old 11th February 2004, 11:50
bdittmar's Avatar
bdittmar bdittmar is offline
Guru
 
Join Date: Apr 2002
Location: Germany, 50.584097,8.544078
Posts: 1,639
bdittmar will become famous soon enough
Baan: 2.2/3.1/4c4/LN6.1 FP6/FP9/HiDox - DB: tbase, ms-sql7, oracle10gV1, 11g - OS: HP-UX, W2K3, SLES
Re: select statement in script option

Hello,

if you want to check the effictivity date of a bom component, do it in an function:

e.g.

function eff.date()
{
if tibom010.indt <= date.num() and (date.num() < tibom010.exdt
or tibom010.exdt = 0) then
effectivity.date = true
else
effectivity.date = true
endif
}


Regards Bernd
Reply With Quote
Sponsored Links
  #4  
Old 17th February 2004, 20:08
ltannous's Avatar
ltannous ltannous is offline
Senior Member
 
Join Date: Sep 2002
Location: Canada
Posts: 280
ltannous is on a distinguished road
Baan: 4c4 - DB: Oracle - OS: UNIX
Not sure why it is not reading my function

It seems as if it is not using the function to check the bom dates.
Here is what I am trying to establish.
functions:
Code:
function read.main.table()
{
	domain tcdate date.use, eff.date
	date.use = date.num()
	check.component.effectivity.date()
	if effectivity.date = true then
	select	tdpsc001.*, tdpsc013.*, titem.dsca:item.dsca, tanl1.dsca:anl1.dsca, 
		tanl2.dsca:anl2.dsca, tcmcs002.*, tcuqp.dsca:cuqp.dsca, 
		tcupp.dsca:cupp.dsca, tatyp.dsca:atyp.dsca, tbtyp.dsca:btyp.dsca, 
		tmtyp.dsca:mtyp.dsca, tutyp.dsca:utyp.dsca, tcmcs070.*,tcmcs003.*, taodl.dsca:aodl.dsca, odl.dsca:bodl.dsca, 
tmodl.dsca:modl.dsca, tuodl.dsca:uodl.dsca, tcmcs046.*,tcs074.*, tccom001.*
from tdpsc001, tdpsc013, tiitm001 titem, tcmcs072 tanl1, tcmcs072 tanl2, tcmcs002, tcmcs001 tcuqp, tcmcs001 tcupp, 
tiitm001 tatyp, tiitm001 tbtyp, tiitm001 tmtyp, tiitm001 tutyp, 
tcmcs070, tcmcs003, tcmcs071 taodl, tcmcs071 tbodl, tcmcs071tmodl,tcmcs071 tuodl, tcmcs046, tcmcs074, tccom001, tiitm001
where	tdpsc001._index3 inrange {:item.f, :suno.f, :cont.f, 
		:pono.f}
	                     and {:item.t, :suno.t, :cont.t, :pono.t}
	and	tdpsc001.suno refers to tdpsc013
	and 	tdpsc001.item refers to titem
	and 	tdpsc001.anl1 refers to tanl1
	and 	tdpsc001.anl2 refers to tanl2
	and	tdpsc001.ccur refers to tcmcs002
	and 	tdpsc001.cuqp refers to tcuqp
	and 	tdpsc001.cupp refers to tcupp
	and 	tdpsc001.atyp refers to tatyp
	and 	tdpsc001.btyp refers to tbtyp
	and 	tdpsc001.mtyp refers to tmtyp
	and 	tdpsc001.utyp refers to tutyp
	and	tdpsc001.stat refers to tcmcs070
	and	tdpsc001.cwar refers to tcmcs003
	and 	tdpsc001.aodl refers to taodl
	and 	tdpsc001.bodl refers to tbodl
	and 	tdpsc001.modl refers to tmodl
	and 	tdpsc001.uodl refers to tuodl
	and	tdpsc001.clan refers to tcmcs046
	and	tdpsc001.ship refers to tcmcs074
	and	tdpsc001.cpln refers to tccom001
	and     tdpsc001.stat = "LV"
	and     tdpsc001.item = :tibom010.sitm 
	and     tiitm001.item = :tibom010.mitm
	and     tiitm001.csig <> "OBS"
	order by tdpsc001._index2
	selectdo
			rprt_send()
					
			endselect
		endif	
}

function check.component.effectivity.date()
{
	domain	tcsern	tmp.seqn
	if (((tibom010.indt <= date.f) and (tibom010.exdt >= date.t) or
		   (tibom010.exdt = 0))) then
	effectivity.date = true
	select	tibom010.*
	from 	tibom010
	where	tibom010._index1 = {:tibom010.mitm,
				    :tibom010.pono}
			order by tibom010._index1 desc
			as set with 1 rows
			selectdo
					endselect
	else
		effectivity.date = false
	endif
}
Reply With Quote
  #5  
Old 17th February 2004, 20:37
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Previous posts

From the previous posts it looks like you are using date.num(). But in your effectivity check it looks like you are using date.f and date.t. Is this some input range? Most of my effectivity checks use only one specified date as the previous post. In my subroutine the user provides the eff.date in the form. See below:

Code:
function check.component.effectivity.date()
{
	domain	tcsern	tmp.seqn

	if ((tibom010.indt <= eff.date) and (eff.date < tibom010.exdt or
	   tibom010.exdt = 0)) then
		effectivity.date = true
		select	tibom010.mitm, tibom010.pono,
			tibom010.seqn:tmp.seqn
		from	tibom010
		where	tibom010._index1 = {:tibom010.mitm,
					    :tibom010.pono,
					    :tibom010.seqn}	| Added 011802
		order by tibom010._index1 desc
		as set with 1 rows
		selectdo
			seqn.stack(level) = tmp.seqn
		endselect
	else
		effectivity.date = false
	endif
}
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
Select problem.question (like statement) ssbaan Tools Development 9 17th October 2003 16:24


All times are GMT +2. The time now is 03:48.


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