Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

SQL Query Syntax

Posted on by 340

I am querying GL20000 - Open Financial Transactions Table.

One column I want to include is 'TRXDATE' which is a datetime type. The values stored are in the 'YYYY-MM-DD HH:MM:SS' format.

If my select statement is:

Select OPENYEAR, JRNENTRY, TRXDATE from GL20000, as an example,

What syntax should I use with the column name so that the return for TRXDATE is formatted as 'mm/dd/yyyy'?

In the table, if my return includes 500 transaction records, every date in the current open year may have been used.

*This post is locked for comments

  • mikepeck Profile Picture
    mikepeck 340 on at
    RE: SQL Query Syntax

    Thank you very much for your answer. I tried it and it provided exactly the return I wanted.

  • Verified answer
    Almas Mahfooz Profile Picture
    Almas Mahfooz 11,003 User Group Leader on at
    RE: SQL Query Syntax

    Select OPENYEAR, JRNENTRY, TRXDATE, convert(varchar,TRXDATE, 101)  from GL20000

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans