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 29th March 2006, 13:46
jeffersyuan jeffersyuan is offline
Senior Member
 
Join Date: Jan 2006
Posts: 273
jeffersyuan is on a distinguished road
Baan: B4,B50C, LN FP1-FP10 - DB: SQL Server , Oracle - OS: Window , Unix , AIX
How to compare current date and date field ?

Hi ,
I want to filter data by current date and date field in the database.

How to do it ?

I find an example script in baanboard, ex. BOM
But , i found it will not work.

domain tcdate eff.date
eff.date = DATE.NUM()

select tdpur045.item,tdpur045.quap
from tdpur045
where tdpur045.date >= {:eff.date} and
tdpur045.date <= {:eff.date}

In Debug mode ,i find eff.date is very smaller , and tupur045.date is very big.

Thank you.
Reply With Quote
  #2  
Old 29th March 2006, 14:18
george7a's Avatar
george7a george7a is offline
Guru
 
Join Date: May 2004
Location: Nazareth
Posts: 1,490
george7a is on a distinguished road
Baan: IVc, 5.0 b, 5.0 c, LN 6.1 - DB: MS SQL, Oracle - OS: Windows 2000, 2003 & UNIX
Hi,

Date.Num returns the number of days from 01-01-0001 to the system date.

Check the following links:
http://www.baanboard.com/baanboard/s...ad.php?t=16190

Dates, times, time zones synopsis:
http://www.baanboard.com/programmers...zones_synopsis

I hope it helps,

- George
__________________
_
George Abdo
NAZDAQ - Your Documents, Your Way.
Reply With Quote
  #3  
Old 6th April 2006, 09:47
cuiwenyuan's Avatar
cuiwenyuan cuiwenyuan is offline
Member
 
Join Date: Sep 2005
Location: Shanghai
Posts: 45
cuiwenyuan is on a distinguished road
Baan: B50/B/C,LN - DB: oracle 8i/10g - OS: HP UNIX
What is wrong, please see below scripts.
extern domain tiutcd eff.date | effectivity date

select tdipu010.item
from tdipu010,tcibd001
where tdipu010.item = :item.pur | Item Range
and tdipu010.item = tcibd001.item | Item Code
and tdipu010.citg = tcibd001.citg | Item Group
and tdipu010.efdt <= :eff.date | Effective Date
and tdipu010.exdt >= :eff.date | Expiration Date
as set with 1 rows
selectdo
| message("Pur Item:%s",item.pur)
selectempty
endselect
__________________
Troy Cui
BaaN V/LN Developer in Shanghai,China
Homepage: http://www.cuiwenyuan.com/baan/
BBS: http://www.xihome.com/ http://www.baanerp.com/

Last edited by cuiwenyuan : 6th April 2006 at 09:54.
Reply With Quote
  #4  
Old 6th April 2006, 15:25
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,904
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Why is the tcibd001 table even in the query? You do not pull any fields nor is any of the where clause checking an external variable. Is this the actual query? I am just wondering if the tpipu010.efdt is actual part of the tcibd001 table. Since I do not know baan 5 or these tables this is just a guess.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #5  
Old 7th April 2006, 10:10
ARijke ARijke is offline
Guru
 
Join Date: Sep 2005
Posts: 455
ARijke is on a distinguished road
Baan: Baan IV upto LN - DB: -- - OS: --
item filled or itemgroup

Hi,

Your query is looking for ipu010 records with item filled and itemgroup filled. This is not ok. Only one of the two is filled.
We use the next query:
select tdipu010.*
from tdipu010
where tdipu010._index2 = {:i.otbp}
and (tdipu010.efdt <= :i.efdt and
tdipu010.exdt >= :i.efdt)
and (tdipu010.citg = :l.citg or tdipu010.citg = "")
and (tdipu010.item = :i.item or tdipu010.item = "")
and (tdipu010.sfbp = :i.sfbp or tdipu010.sfbp = "")
order by tdipu010.citg asc, tdipu010.item desc,
tdipu010.sfbp desc
as set with 1 rows
selectdo
o.mess = ""
return
endselect

Regards, Adriaan
Reply With Quote
  #6  
Old 9th April 2006, 14:07
jeffersyuan jeffersyuan is offline
Senior Member
 
Join Date: Jan 2006
Posts: 273
jeffersyuan is on a distinguished road
Baan: B4,B50C, LN FP1-FP10 - DB: SQL Server , Oracle - OS: Window , Unix , AIX
Dear All,
Thank you for your help.

I found the problem is , in baan 5 , it will use UTC , So should use utc.num

Thank you.
Reply With Quote
Sponsored Links
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
Baan null date field view from oracle sql zaidlaz Tools Development 9 21st June 2006 17:13
Initial value for a date field BaanForever Tools Development 2 12th November 2003 08:39
Date Field Error during Load Oracle Data into Microsoft SQL server through ODBC wangxn Tools Administration & Installation 2 11th April 2002 14:07


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


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