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 9024025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:54:20+00:00 2026-06-16T05:54:20+00:00

I cannot get the date format correctly in dynamic sql statement, after trying various

  • 0

I cannot get the date format correctly in dynamic sql statement, after trying various ways of handling it. I need some help with the date format.

i am having a posting date field which is stored in sql db as yyyy-mm-dd format..and it displays in the asp web page as mm-dd-yyyy..i need to display the date in dd-mm-yyyy format..is there any way to do this?

this is my sql query:

SELECT CR.Name AS country,C.Name,C.[Name 2],C.[E-Mail],[Pre-Assigned No_], [Posting Date], SIH.[Currency Code], SIH.[Shipment Method Code],[Total Boxes],[ARE Net Wt],[ARE Gr_Wt], SIH.[Shipping Agent Code], SIH.[Payment Terms Code] FROM [Sales Invoice Header] SIH 
INNER JOIN [Country_Region] CR ON CR.Code = SIH.[Country of Final Destination] 
INNER JOIN [Customer] C ON C.No_ = SIH.[Sell-to Customer No_] WHERE SIH.No_ = 'PEXP1213-540'
  • 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-06-16T05:54:21+00:00Added an answer on June 16, 2026 at 5:54 am

    No need to replace direct use 106 or 105 and get the desired format
    SELECT convert(varchar, getdate(), 106) – dd mon yyyy

    so ur query look like

    select  CR.Name as country,C.Name,C.[Name 2],C.[E-Mail],[Pre-Assigned No_], 
    convert(varchar,[Posting Date], 106) AS [Posting Date], SIH.[Currency Code], SIH.[Shipment Method Code],
    [Total Boxes],[ARE Net Wt],[ARE Gr_Wt], SIH.[Shipping Agent Code], SIH.[Payment Terms Code] from [Sales Invoice Header] SIH 
    inner join [Country_Region] CR On CR.Code = SIH.[Country of Final Destination] 
    inner join [Customer] C on C.No_ = SIH.[Sell-to Customer No_] where SIH.No_ = 'PEXP1213-540'
    

    Also can do on codeBehind:

    DateTime time = DateTime.Now;             // Use current time
    string format = "dd mm yyyy";            // Use this format
    Console.WriteLine(time.ToString(format));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to get the date/time format produced from a date / picker which
I cannot seem to get this date picker working at all. I know it
I cannot get this function to fire off... I'm thinking I need a fresh
I have a varchar column which contains date in following format dd/mm/yyyy I need
I get following varaiable, but I cannot format Integer, so is there any way
I'm receiving a date field from a php file, and I need to format
I've had a look around but cannot find the issue with this SQL Statement:
I'm new to MVC3 - and cannot figure out why the Date format validation
I need to print out the current date in the following format : Today
I am trying to modify the date format displayed in a custom template using

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.