rreichenbach
5th May 2011, 15:21
We want to create a new homepage with new reports and therefore copied some existing ones like 'Processed Purchase Oders' that we want to amend. Now we have the problem that we need to compare a date in date format with a date in utc and we do not know how to set this up in the sql query in Infor Reporting Studio. Does anyone know how to do this? Thanks in advance.

rreichenbach
5th May 2011, 17:20
it seems to work when teh date is converted with cast like CAST(tcccp070.stdt as date)

BeznaWarrior
18th May 2011, 16:09
Do you have a sugestion for utc date format? the cast(tablefield as date) seems to work only for simple dates not for utc format... I'm using 2 parameters in a session and cannot compare them to an utc field from baan :((

bdittmar
18th May 2011, 18:20
We want to create a new homepage with new reports and therefore copied some existing ones like 'Processed Purchase Oders' that we want to amend. Now we have the problem that we need to compare a date in date format with a date in utc and we do not know how to set this up in the sql query in Infor Reporting Studio. Does anyone know how to do this? Thanks in advance.

Hello,

use sprintf$() functions like:

Dates

| Suppose date format 002 is: "year/month/day in month"

string result(80)

result = sprintf$("%D002", 727168)

| result contains "1991/12/2"

| Example of substitution symbol %D(format)

string result(80)

result = sprintf$("%D(Date: %02d/%02m/%04Y)", date.num())

| result contains "Date: 12/07/1993"

result = sprintf$("Date: %D(%02d %-20H %04Y)", date.num())

| result contains "Date: 12 June 1993"

UTC dates and times

| Date format 002 is "year/month/day in month"

| Time format 001 is "12 hour format:minutes:seconds AM/PM symbol"

string result(80)

result = sprintf$("%u002 %001", utc.num(), utc.num())

| Result contains "1997/01/01 10:02:53 pm"

string result(80)

result = sprintf$("UTC: %u(%02d/%02m/%04Y) %U(%02h%x%02m%x%025 %a)", utc.num(), utc.num())

| result contains "UTC: 22/07/1997 06:24:53 am"

| provided that for the user's language the time

| separator is ":" and the AM symbol is "am"

| Using a comma after a %u substitution symbol

string result(80)

result = sprintf$("%u001, ,Message text....", utc.now())

| result containts "06-05-15,Message text...."

Regards