473,809 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

windows date

How can I convert a windows date stored in Mysql (ie 38397 for today) to something I can use in a where clause?

Thnaks,

Bart
Jul 23 '05 #1
2 1109
B. Verkerk wrote:
How can I convert a windows date stored in Mysql (ie 38397 for today) to something I can use in a where clause?


Here's an expression that converts the value 38397 to '2005-02-14'.
Does this do what you want?

mysql> SELECT FROM_DAYS( 38397 + TO_DAYS('1899-12-30') );
+--------------------------------------------+
| FROM_DAYS( 38397 + TO_DAYS('1899-12-30') ) |
+--------------------------------------------+
| 2005-02-14 |
+--------------------------------------------+
1 row in set (0.00 sec)

Regards,
Bill K.
Jul 23 '05 #2
thanks!

"Bill Karwin" <bi**@karwin.co m> schreef in bericht news:cu******** *@enews4.newsgu y.com...
B. Verkerk wrote:
How can I convert a windows date stored in Mysql (ie 38397 for today) to something I can use in a where clause?


Here's an expression that converts the value 38397 to '2005-02-14'.
Does this do what you want?

mysql> SELECT FROM_DAYS( 38397 + TO_DAYS('1899-12-30') );
+--------------------------------------------+
| FROM_DAYS( 38397 + TO_DAYS('1899-12-30') ) |
+--------------------------------------------+
| 2005-02-14 |
+--------------------------------------------+
1 row in set (0.00 sec)

Regards,
Bill K.

Jul 23 '05 #3

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

Similar topics

1
3296
by: Fons Dijkstra | last post by:
Hello, I'm using the mx.ODBC.Windows package in order to read/write a MSAccess database. Everything works fine apart from the DATE format handling. I'm using the default "datetimeformat" (i.e. DATETIME_DATETIMEFORMAT) as suggested. The date columns in the MSAccess database have "Short Date" format. When I read a DATE item everything works fine, like:
5
7195
by: Eric Chong | last post by:
I created a Windows Service in C# that requires to get passed command arguments like a Console App. I noticed that there is an option "Start parameters" text box in the property of a Windows Service in MMC. Is there any way to get arguments using this option? If possible, what framework method should I use to get an arguement? Thanks in advance. Eric
2
15233
by: Ken Lindner | last post by:
I have a need to become familiar with SQL Server 2000 for work. Needless to say I am new to SQL Server any version, but not IT in general. My employer has provided me with the SQL Server 2000 Personal disk from the SQL Server 2000 Enterprise kit as this is reported here on the MSDN web site to be the version that is supported on Windows XP. In fact so many of you kind people confess to having succeeded in doing it. I have tried...
8
4196
by: Bill Sonia | last post by:
I've written a Windows Service to send e-mails on events like OnStart, OnStop, OnShutDown using System.Web.Mail. It works for everything but OnShutdown. My guess is that for OnShutDown, once my send mail code is executed, other necessary Windows Services have been terminated before it can actually send the mail. I've updated my HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services registry DependOnService value including SMPTSVC and...
0
1377
by: lanky_tx | last post by:
Hi All, I am trying to acess the rows within a child table of a windows form datagrid. I have tried using the CurrencyManager & BindingManagerBase to get the data but doesn't work. The problem is that when trying to retrive a row from a childtable in a datagrid using either objects it still retrieves the parents data. I want the selected childtable row data.
0
1419
by: Luis Esteban Valencia | last post by:
Hi, I am using windows 2000 Pro with SP4 for development and database is access2000. Regional Setting is as follows: Regional Options: Your locale(location): English United States short date format: M/d/yyyy long date: dddd, MMMM dd, yyyy
2
11093
by: Ryanfai | last post by:
I use the vb.net make the program that save the date and any Information field. when I input the date in textbox then I save to database occurs error that is "Cast from string "20/08/2003" to type 'Date' is not valid. I use this command change string to Date dim year as date dim strYear as string => year = ctype(stryear,Date).ADDYEAR(2) I only in Windows 98 have problem
3
1939
by: Trevor | last post by:
This is driving us mad - please help! Back in 2003, I coded a Windows Service in VB.NET for framework v1.1.4322. I deployed it in Nov. 2003, and it worked fine until the end of May 2005, when it choked (see below). We restarted it, and it worked fine for another 7 months until it choked again at the end of Dec. 2005. It has now failed again (mid Feb. 2006). So it's failing more frequently now? OnStart, the service reads a number of...
2
2463
by: Trevor | last post by:
Argh! This problem is driving me nuts! Can you help? In November of 2003, I installed a web service on Windows Server 2003 built in VB.NET for v1.1.4322 of the framework. It contains a timer (System.Timers.Timer) which has an interval of 24 hours. Actually, it reads a time like 2AM out of the config file, and calculates the time between the start of the service to 2AM, and sets the timer. When the timer expires, it re-reads the...
1
6526
by: schouwla | last post by:
Hi, I want to create dates in the following format: dd-MMM-yyyy e.g. 13- Mar-2007 But are seeing some problems when running on a Japanese Windows XP. Regional settings are set to JP. Currently I am doing this DateTime dat = DateTime.Now;
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10120
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7662
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5689
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.