Granholm
22nd June 2009, 17:55
Hi all,

I need to get BOM lines out in an Easy SQL that has an expiredate higher than today but the help session in LN says use Date() to get today's date. This function is not acceptetd by easy SQL so I am lost. Anyone that can help?? The table field I need to extract is tibom010.exdt.

Thans in advance ;o)

bdittmar
22nd June 2009, 21:20
Hi all,

I need to get BOM lines out in an Easy SQL that has an expiredate higher than today but the help session in LN says use Date() to get today's date. This function is not acceptetd by easy SQL so I am lost. Anyone that can help?? The table field I need to extract is tibom010.exdt.

Thans in advance ;o)

Hello,

try date.num()

Regards

Granholm
23rd June 2009, 10:23
Thanks for the advice. But now I get a new error. Have you any advice here?

The Query statement is this:
select
tibom010.mitm, | Manufactured Item
tibom010.sitm, | Item
tcibd001.dsca, | Description
tibom010.qana, | Net Quantity
tibom010.indt, | Effective Date
tibom010.exdt | Expiry Date
from
tcibd001, | Items - General
tibom010 | Bill of Material
where
tibom010.mitm >= tibom010.mitm.f and
tibom010.mitm <= tibom010.mitm.t and
tibom010.exdt >= date.num() and
tibom010.sitm = tcibd001.item

And the error I get is this:
Incompatible types for comparison operator '>=' (error 302)
Error 302 (SQL syntax not correct)

We use LN6 un a MS SQL server if this has any importance?

Any help is greatly appreciated!!

saumya
23rd June 2009, 10:54
declare a variable like
domain tcdate today.date
today.date = date.num()
then use this var in ur sql

dheerendra_gosw
23rd June 2009, 11:20
You can assign the value in variable then use airthmatic operater..

mark_h
23rd June 2009, 15:54
In 4c4 easy sql I enter a date like this --->>>> tpbcr606.date = date(2007,09,28). I am not positive about ln.

shah_bs
23rd June 2009, 23:29
I was curious so I tried out the following in EASY SQL and it works (in BAAN IVc3 at least):


select
tibom010.exdt, | Expiry Date
tibom010.mitm, | Manufactured Item
tibom010.sitm | Item
from
tibom010 | Production BOMs
where
tibom010.exdt > date()



Maybe an issue with LN version of EASY SQL?

On the Form Editor, I can use just date [instead of date() ] - have you tried date. date = today in BAAN IVc3 form editor.

So for instance, the following may work for you:



select
tibom010.exdt, | Expiry Date
tibom010.mitm, | Manufactured Item
tibom010.sitm | Item
from
tibom010 | Production BOMs
where
tibom010.exdt > date