Solved

Format date in SQL Query for VB6 app

Posted on 2014-04-30
2
652 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

743 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

12 Experts available now in Live!

Get 1:1 Help Now