cancel
Showing results for 
Search instead for 
Did you mean: 

Query Parameter

Former Member
0 Kudos

Hi all,

I hava a query to run on SAP B1 Query Executer with a Date Parameter, so when i execute a query it should ask for the date parameter which the user will pick it up from the datetime picker.

But i find that the [%0] or any other [%..] variable is used for only the table's field.

so is there any possible way to do it.

i have some pseudo query like

*Select * from JDT1 T1 where T1.RefDate=GetLastDateOfMonth('[%0]')*

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Is this GetLastDateOfMonth() an user function by you?

Thanks,

Gordon

Former Member
0 Kudos

Hi GordonDu ,

yes, GetLastDateOfMonth() is my userFunction, and i have to pass the date as parameter to that function, which will return me the last date of the month.

regards

Bikram

Former Member
0 Kudos

In this case, only predefined parameter may work for you.

Try Declare a variable first.

Former Member
0 Kudos

Hi GordonDu,

I have tried for predefined parameter as

Declare @myParam as datetime

set @myParam=[[%0]]

Select * from JDT1 where RateDate=GetLastDateOfMonth(@myParam)

And it still is not working, so i tried to set my parameter as

set @myParam=(Select RateDate form ORTT where RateDate=[[%0]])

regards

Bikram

Former Member
0 Kudos

What is the result of your last try?

Former Member
0 Kudos

Hi,

The result of my Last try was, it prompts a window which shows the list of RateDates, but when i select one of the date, it will show an error message, it means it is not working

regards

Bikram

Former Member
0 Kudos

Could you post the first few line of your function GetLastDateOfMonth()?

Former Member
0 Kudos

Hi

The first line of my function GetLastDateOfMonth() is

(DateAdd(Month,1,@Date-Day(@Date)+1)-1)

where @Date is passed as parameter to this function

regards

Bikram

Former Member
0 Kudos

Do you set up @Date parameter explicitly?

Answers (0)