?
Solved

VB 4.0 & Informix 6.0 DateTime Query

Posted on 1998-06-07
2
Medium Priority
?
587 Views
Last Modified: 2008-02-26
I have a Informix 6.0 and VB 4.0 and used  ODBC. I can use sql query for returning recordset of text, integer and other data field.
My problems is how to query DateTime data fields. My date fields is in yyyy/mm/dd hh:nn:ss formats in Informix.

0
Comment
Question by:sujatha060198
[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 4

Accepted Solution

by:
yowkee earned 150 total points
ID: 1462751
Just treat it as string.
For example, there is a table

Create table TabTest
(
  MyDate  DATETIME
)

SQL statement for query for the datetime field,

  select * from TabTest
  where DATETIME = '1998/06/08 14:46:22'

eg, In you code(assume DAO)

  ' db is the database object
  Dim rst As RecordSet
  Dim sSQL As String

  sSQL = "Select * from TabTest where MyDate = '" + _
         Format(Now, "yyyy/mm/dd hh:mm:ss") + "'"
  Set rst = db.OpenRecordset(sSQL, dbOpenSnapshot, dbReadOnly)
 

 
0
 

Author Comment

by:sujatha060198
ID: 1462752
Informix datetime format also are in the format of '1998-06-08 14:46:22'. So one must make sure in which format they are before making the date time.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month15 days, 5 hours left to enroll

770 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