|
|
I tried this
select convert(datetime, 41818) as mydate
result
2014-06-30 00:00:00.000
In Excel, it should be
6/28/2014
It's always 2 days in advance
Please help!
Thanks a lot
|
|
|
|
|
Why do you think it's wrong?
SELECT DATEDIFF ( dd , '1900-01-01' , '2014-06-30' )
SELECT DATEADD ( dd, 41818 , '1900-01-01' )
Miller Nguyen wrote: In Excel, it should be
What do you mean "it should be" ?
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
I don't say it's wrong, that's why I put the QUESTION MARK in the topic.
I just wonder why Excel and SQL are giving different result
|
|
|
|
|
What the f...? You are right, I tested it.
Look at day number 0: with SQL Server, it is Jan 1, 1900; with Excel: Jan 0 , 1900.
The next bug is the leap year: Excel treats 1900 as a leap year (that's wrong!), while SQL Server correctly knows that 1900 is not a leap year.
In sum, those differences account for the 2 days difference in current dates.
|
|
|
|
|
|
Yeah, as I drifted off to sleep last night I recalled that Joel had written about Excel having to support a Lotus 123 issue.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
I love that story.
They brought a f*** counter to all meetings with BillG.
|
|
|
|
|
See my answer to Bernhard
|
|
|
|
|
|
Oh, btw, have a look if this[^] and this[^] would be of any use for you.
|
|
|
|
|
For example, -0.5 and 0.5 both mean noon on 30 December 1899 No, no, no! I do not want to use that function!
|
|
|
|
|
It's not a bug, it's a feature.
|
|
|
|
|
I get around this, and other issues such as collation issues between SQL Server and Excel, by always passing dates to Excel as text in a format of dd-MMM-yyyy e.g. '01-Jan-2014'.
It's not pretty but it has worked so far...
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
modified 30-Jun-14 8:06am.
|
|
|
|
|
Hi all;
I am learning to write stored procs on MySQL and am going crazy.
DELIMITER $$
DROP PROCEDURE IF EXISTS CleanCopyEnvData$$
CREATE PROCEDURE CleanCopyEnvData ()
BEGIN
insert into EnvData(UserDate, XAction, Balance, UserID)
select
CAST(udate as Date)
, CAST(amount1 as Decimal(6,3))
, CAST(amount2 as Decimal(6,3))
, CAST(UID as UnSigned)
from
DataLoad;
END $$
DELIMITER ;
I get an error:
Error starting at line : 17 in command -
END $$
Error at Command Line : 17 Column : 1
Error report -
SQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END $$' at line 1
I am using Oracle SQL Developer and the INSERT statement works ok when executed on its own. I can do these things blindfolded with my arms tied on MSSQL. Any help appreciated.
EG.
|
|
|
|
|
You don't need the delimiter expression $$ after your END statement.
DELIMITER $$
DROP PROCEDURE IF EXISTS CleanCopyEnvData$$
CREATE PROCEDURE CleanCopyEnvData ()
BEGIN
insert into EnvData(UserDate, XAction, Balance, UserID)
select
CAST(udate as Date)
, CAST(amount1 as Decimal(6,3))
, CAST(amount2 as Decimal(6,3))
, CAST(UID as UnSigned)
from
DataLoad;
END
Everyone dies - but not everyone lives
|
|
|
|
|
|
Glad to help.
Everyone dies - but not everyone lives
|
|
|
|
|
Hi,
I have .NET WinForm application with MySQL backend.
It's an HR application.
I want to store employee documents such as ID card, passport, letters (e.g. salary certificates, warning letters, etc).
I don't want to store the scanned documents in the database itself therefore I am planning to store it on my file server and just save a link in MySQL.
My question, if I save a link, how can I make sure no one will know that link's folder then open it and see everything else?
Technology News @ www.JassimRahma.com
|
|
|
|
|
Just store the filenames without the path to the file server in the database table. Store the path to the file server separately say in another database table and concatenate it with the filename by code whenever user wants to access a file.
|
|
|
|
|
Instead of using a plain database back-end, create a server which communicates with the clients and the database. So any client will contact the server which in turn talks to the database and file system, and serves the data/documents back to the clients.
|
|
|
|
|
what is difference and similarities between mysql and ms sql server.
|
|
|
|
|
They are exactly the same except SQL Server is better in every way.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
can we use them by replacing each other with other tools for example can i use mysql with asp.net and php with ms sql server
|
|
|
|
|
Mix and match to your heart's content.
Best use a layered approach of course. The front-end shouldn't care what the back-end is.
You'll never get very far if all you do is follow instructions.
|
|
|
|