Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7581361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:11:02+00:00 2026-05-30T18:11:02+00:00

I have this query select * from openQuery(hades,select to_char(T$STDT,’dd-Mon-YYYY’) stdt,to_char(T$TDAT,’dd-Mon-YYYY’) tdat ,fdG2J(T$TDAT)-fdG2J(t$stdt) diff,T$DISC ,fdG2J(Sysdate)

  • 0

I have this query

select * from openQuery(hades,"select to_char(T$STDT,'dd-Mon-YYYY') stdt,to_char(T$TDAT,'dd-Mon-YYYY') tdat
    ,fdG2J(T$TDAT)-fdG2J(t$stdt) diff,T$DISC 
    ,fdG2J(Sysdate) nSysD
    ,fdG2J(t$stdt) nStdt
    ,fdg2J(t$tdat) nTdat
    from BAAN.TTDSLS031020 
where T$CUNO='000022' and TRIM(T$CPGS)='1AA00'
--and fdG2J(sysdate) between fdG2J(t$stdt) and fdG2J(t$stdt) 
");

and returns the following result (not that the last line of the where clause is commented out).

STDT        TDAT        DIFF        T$DISC  NSYSD   NSTDT   NTDAT
01-Mar-12   11-Mar-12   10010       40  2455990063  2455988061  2455998071
02-Mar-12   02-Mar-12   0           50  2455990063  2455989062  2455989062
06-Mar-12   11-Mar-12   5005        60  2455990063  2455993066  2455998071
11-Mar-12   11-Mar-12   0           70  2455990063  2455998071  2455998071
18-Jul-39   01-Jan-12   2907496166  80  2455990063  2465988199  5373484365
15-Dec-85   01-Jan-12   2817496016  80  2455990063  2555988349  5373484365

and whe I apply the commented between clause , the query returns no results (through sql2008 linked server)

and when I run the same query from Sql Developer (Oracle)

I get the first row

what is intriguing is:
a) why does this return different results when executed in different environments (although the server running the query is same server)?
b).why dos not between clause do not return expected result ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T18:11:03+00:00Added an answer on May 30, 2026 at 6:11 pm

    I don’t know the indended functionality of fdG2J(), but in the BETWEEN clause, you use the same function call and argument value for both. Therefore, both return the same value and fdG2J(sysdate) would need to be exactly equal rather than between the range points.

    and fdG2J(sysdate) between fdG2J(t$stdt) and fdG2J(t$stdt) 
    -- -                            ^^^^^^^^  Same as ^^^^^^^^
    

    Perhaps you intended:

    and fdG2J(sysdate) between fdG2J(t$stdt) and fdG2J(T$TDAT) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this query: SELECT * FROM sample INNER JOIN test ON sample.sample_number =
Let's say I have this query: select * from table1 r where r.x =
I have got this query: SELECT * FROM `mfw_navnode` n1 WHERE (n1.node_name='Eby' OR n1.node_name='Lana'
I have this query: mysql_select_db('scanner'); $query = SELECT * FROM scanner.proxy ORDER BY RAND()
I have used this query before: SELECT * FROM stone_list WHERE type IN ('ALEXANDRITE','AMETHYST')
I currently have this query: SELECT s_id FROM orderline,order_t WHERE orderline.o_id=order_t.o_id AND c_name='John Smith';
I have this query: SELECT COUNT(articles.id) AS count FROM articles, xml_documents, streams WHERE articles.xml_document_id
I have this query: select BUnit, value from myTable where BUnit in (555,556,557,558) and
I have this query: SELECT * FROM bookmarks WHERE id=? ORDER BY title ASC,
i have this query: select eid from event where creator = 100000956216009 Return this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.