Solved

Format date in SQL Query for VB6 app

Posted on 2014-04-30
2
719 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 77

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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

696 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