Solved

VB 4.0 & Informix 6.0 DateTime Query

Posted on 1998-06-07
2
585 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 50 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Add a task in Outlook from access 11 43
How to measure sizes and angles in scanned images ? 3 99
VB6 ListBox Question 4 62
IF ELSE Statement in Excel Macro VBA 16 98
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

732 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