Solved

Format date in SQL Query for VB6 app

Posted on 2014-04-30
2
660 Views
Last Modified: 2014-04-30
I am trying to pull data from an Oracle database to populate a MSHFlexgrid in a VB6. The date field is showing up at "mm/dd/yyy 00:00:00"

This is my query: "SELECT job, prog, add_edit_date, order_status, edited_by From JOBNO_PROGNO WHERE (ORDER_STATUS = 'A')  ORDER BY prog, job"

Isn't there a way to format the date inside the query?
0
Comment
Question by:lakhi
2 Comments
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 325 total points
ID: 40032477
>>Isn't there a way to format the date inside the query?

Yes, use TO_CHAR and a format mask to convert the date to a string:

 "SELECT job, prog, to_char(add_edit_date,'MM/DD/YYYY') add_edit_date, order_status, edited_by From JOBNO_PROGNO WHERE (ORDER_STATUS = 'A')  ORDER BY prog, job"

What format do you want it to appear in?
0
 

Author Closing Comment

by:lakhi
ID: 40032588
Perfect! Just what I was looking for, Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This video teaches viewers about errors in exception handling.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now