yogesh kapil
3rd January 2013, 09:32
hi Expert,

i want to get the record from whinr110 table on 01-04-2012 date, for this i write the folowing code but not working.

can somebody help me.

Thanks and Regards
Yogesh Kapil




select whinr110.*
from whinr110
where whinr110.item = :hold.item
and whinr110.cwar = :hold.cwar
and whinr110.phtr = tcyesno.yes
and whinr110.trdt = 01-04-2012

selectdo
open_blc = whinr110.qhnd
endselect

mark_h
3rd January 2013, 14:42
Well in baan 4 I use tpbcr601.date = date(2012, 02, 10). but if this is ln and a utc date I am not sure that will work. You can search utc dates on this forum and see what options there are - I think it is like date.to.utc or something like that.

BaanInOhio
3rd January 2013, 18:05
Since UTC dates also include time, you will have to use a 'between' in your where clause from the date at '00' minutes to the last minute of the day. There are some standard DLLs you can use but you can also use the UTC date functions to set the dates yourself:


domain tcdate utc.f, utc.t
domain tfgld.date date.f
long mm, dd, yy

date.f = date.num()
local.to.utc(date.f, 0, utc.f)
local.to.utc(date.f+1, 0, utc.t)
utc.t = utc.t - 1

select whinr110.*
from whinr110
where whinr110.item = :hold.item
and whinr110.cwar = :hold.cwar
and whinr110.phtr = tcyesno.yes
and whinr110.trdt between :utc.f and :utc.t
selectdo



The UTC dates can be set a few different ways. This example uses the current date (date.num) then applies the times. You can also directly set the UTC dates using specific times (00:00:00 and 23:59:59) using date.to.utc(yy, mm, dd, hrs, min, sec).

yogesh kapil
4th January 2013, 09:21
Hi BaanInOhio,

You are right date.to.utc() work for me.


utc = date.to.utc( 2012, 04, 02, 00, 00, 00 )
if whinr110.trdt < utc and whinr110.kost=tckost.stc.correction then
open_blc = whinr110.qstk
else
open_blc=0
endif

Thank you so much.

yogesh kapil
4th January 2013, 09:24
HI Mark,

Thanks for your reply. Actually we have LNFP7. You are right date(2012, 02, 10) nt work for utc date.

well i use date.to.utc() which work very fine.

Thank you so much.

Thanks and Regards
Yogesh Kapil