cancel
Showing results for 
Search instead for 
Did you mean: 

Query not working

Former Member
0 Kudos

Dear Experts,

I am trying to execute a query provided in 'How to define and use user-defined fields' doc under How to guides for SBO 8.8 but it is giving me error "incorrect syntax near...."

The Sample query i m trying to execute, which is for adding 20 in the posting date of current active sales document (not stored in database), is : Select $[$10.0.Date] + 20

This query will be used in Due date to automatically retrieve a date which 20 days forward from the posting date.

When I am executing the above query it is give me error: SQL native client "incorrect syntax near '+' and user-defined value could be created.

Please help resolving this issue. I am using SAP Business one 8.8 SP0 PL09

Regards,

Farhan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Dear Farhan

This query: Select $[$10.0.Date\] + 20 has to be saved first. Then assign to FMS.

It should work.

Thanks,

Gordon

Former Member
0 Kudos

Thanks Gordon,

It worked.

Regards,

Farhan

Answers (1)

Answers (1)

former_member325312
Active Contributor
0 Kudos

Hi

Farhan here is ur querys u can use any one of these

i think this will solve ur prob

SELECT Docnum,DocDate,DATEADD(day,20,DocDate)

FROM ORDR

(OR)

SELECT Docnum,Convert(varchar(11),DocDate,103),Convert(varchar(11),DATEADD(Day,20,DocDate),103)

FROM ORDR

regards

Jenny

Edited by: Jennifer Anderson on Jul 28, 2010 12:55 PM

Former Member
0 Kudos

Thanks Jennifer,

Your queries worked well on sales document already in database.

Can you please provide me a query for active/ current documents which are not added yet which give me the same result as your queries did.

Actually what I need is when I select the posting date before adding the document and press Tab the due date should automatically display 20 days forward.

I also want to know why the query provided in SAP official guide document is not working and giving me the error I mentioned in my original post.

Thanks and regards.

Farhan