473,473 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DbiDate object

Hi all

I am using odbc to connect to Microsoft Access DB. When I send a
request with a datetime column from the database, odbc returns
something called a DbiDate object.
ex :
>>x=data[0][2]
<DbiDate object at 0x009C4140>
>>print x
Fri Apr 20 07:27:45 2007

I would like to select columns where datetime ("DbiDate column") is >
yesterday date.
and i don't understand how to send request with this DbiDate.

Could you help me ?
thank you

May 28 '07 #1
2 2021
On May 29, 12:51 am, revuesbio <revues...@gmail.comwrote:
Hi all

I am using odbc to connect to Microsoft Access DB. When I send a
request with a datetime column from the database, odbc returns
something called a DbiDate object.
ex :>>x=data[0][2]

<DbiDate object at 0x009C4140>>>print x

Fri Apr 20 07:27:45 2007

I would like to select columns where datetime ("DbiDate column") is >
yesterday date.
and i don't understand how to send request with this DbiDate.

Could you help me ?
thank you
I also use the odbc module, but I store dates in my system as
datetime.datetime objects.

I convert a DbiDate object to a datetime object like this -

import datetime as dt
date = dt.datetime.fromtimestamp(int(dbidate))

For selects, I use the datetime object directly -

cur.execute('select * from table where date = ?',(date,))

I'm not sure how the odbc module handles that - maybe it converts date
into str(date). In any case, it just works for me.

HTH

Frank Millman

May 29 '07 #2
On 29 mai, 07:22, Frank Millman <f...@chagford.comwrote:
On May 29, 12:51 am, revuesbio <revues...@gmail.comwrote:
Hi all
I am using odbc to connect to Microsoft Access DB. When I send a
request with a datetime column from the database, odbc returns
something called a DbiDate object.
ex :>>x=data[0][2]
<DbiDate object at 0x009C4140>>>print x
Fri Apr 20 07:27:45 2007
I would like to select columns where datetime ("DbiDate column") is >
yesterday date.
and i don't understand how to send request with this DbiDate.
Could you help me ?
thank you

I also use the odbc module, but I store dates in my system as
datetime.datetime objects.

I convert a DbiDate object to a datetime object like this -

import datetime as dt
date = dt.datetime.fromtimestamp(int(dbidate))

For selects, I use the datetime object directly -

cur.execute('select * from table where date = ?',(date,))

I'm not sure how the odbc module handles that - maybe it converts date
into str(date). In any case, it just works for me.

HTH

Frank Millman
it works !
thank you for your help ;-)

May 29 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: lawrence | last post by:
How dangerous or stupid is it for an object to have a reference to the object which contains it? If I have a class called $controllerForAll which has an arrray of all the objects that exist, what...
15
by: Ville Vainio | last post by:
Pythonic Nirvana - towards a true Object Oriented Environment ============================================================= IPython (by Francois Pinard) recently (next release - changes are...
1
by: Frank Millman | last post by:
Hi all I am using odbc from win32 extensions to connect to MS SQL Server. I use mx.DateTime to handle dates. When I select a datetime column from the database, odbc returns something called a...
1
by: Bijay Kumar | last post by:
Hi Guys, I was going through the source code of Object.cs in rotor. What I found is Equals() implemented as follows: public extern virtual bool Equals(Object obj); What I don't...
0
by: Bijay Kumar | last post by:
Hi Guys, I was going through the source code of Object class (Object.cs in rotor). What I found is Equals() implemented as follows: public extern virtual bool Equals(Object obj); What...
26
by: yb | last post by:
Hi, Is there a standard for the global 'window' object in browsers? For example, it supports methods such as setInterval and clearInterval, and several others. I know that w3c standardized...
7
by: flupke | last post by:
I'm using a solid DB and i'm accessing it via the odbc module (activepython). I get a DbiDate object returned but i don't find a way to decently print it or get a format like %d/%m%/%y. I found...
3
by: User1014 | last post by:
A global variable is really just a property of the "Global Object", so what does that make a function defined in the global context? A method of the Global Object? ...
2
by: Ralph | last post by:
Hi I don't understand why it's not working: function schedule(imTop){ this.tdImagesTop = imTop; } schedule.prototype.selectEl = function() { alert(this.tdImagesTop);
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.