Skip to Content
avatar image
Former Member

Query with variable and restriction

Dear All

I want obtain limited list.

Example,when I use in query

set @DataFrom = (select min(T3.TaxDate) from dbo.OJDT T3 where T3.TaxDate >= '[%2]')

I can choose data from firt to last Journal Entry.

What can I do when I what show data only from 2009 year?

Thanks in advance

Tom

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 19, 2010 at 08:58 PM

    Thanks for all response.

    I think that I didn't explain enough my problem.

    When I have a code in query

    set @DataFrom = (select min(T3.TaxDate) from dbo.OJDT T3 where T3.TaxDate >= '%2')

    after launch a query appear a window where I can write date or I can choose date from list.

    I need in this list only date from 2009 year.

    Tom

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 17, 2010 at 11:25 AM

    Hello

    I am suggest to use FInancial Period from / To instead of booking dates, if it is possible. I mean if you need month end closing dates, it would work fine.

    If you need dates, why are you using list, not dates as parameters?

    Regards

    János

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 17, 2010 at 01:52 PM

    Dear Tom,

    How about use Year(T3.TaxDate) = 2009 directly in your query? You don't need start date and end date for this condition.

    Thanks,

    Gordon

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 21, 2010 at 06:01 AM

    What a pity!

    Thanks for answer.

    Tom

    Add comment
    10|10000 characters needed characters exceeded