August 12, 2020 at 6:33 pm
Michael L John wrote:So, getting my 8 and 10 year old grand kids to take showers during the Covid crisis has been tough. Today, after a lot of begging, the 8 year old finally goes and gets a shower.
I'm on my weekly Teams call with my boss, and a semi-naked wet little boy comes strolling up behind me. My boss lost it. He was laughing so hard he had to end the meeting.
hahaha....sounds familiar. "You need to take a shower"....."um, how about tomorrow" *finger guns*
Well, today was "I just took a shower". I asked when. He said 'When I was at grandmas". That was 4 days ago.
Michael L John
If you assassinate a DBA, would you pull a trigger?
To properly post on a forum:
http://www.sqlservercentral.com/articles/61537/
August 12, 2020 at 7:49 pm
Someone has to come clean, where is the Crystal Ball?
😎
August 12, 2020 at 7:49 pm
It takes less than 10 keystrokes to convert a column to text. (Ctrl + space, alt + 1, alt + C, t, t enter)
I'm getting the impression that you think a product for hundreds of millions of users has to work the way you want it to. If it doesn't, the product is bad.
Well for my comment, I actually would like it to do some work with this. I'm not really sure how the clipboard internals looks coming from SSMS for instance and I get that, its been a long time since I coded using the copy paste buffer for any windows api (literally 16 bit windows the last time I read a copy paste buffer with c). But man, the interpretation excel gives to any date looking thing from the copy / paste buffer is baffling, the windows programmers have obviously put much effort into interpreting this into SOMETHING because of what I see get pasted if I DON'T format the receiving cells as text.
Check it out sometime, I'd be curious if anybody knew what the excel programmers were actually trying to do with a date time value to end up with what actually gets pasted, I'm sure somebody smarter than me might have an idea. Do you?
Maybe scientific notation? Internal SQL bit patterns as a representation of date? *shrug* beats the heck out of me LOL
edit: I'd think MAYBE its because of what SSMS pokes into the buffer from an SSMS date column but then why does a text formatted cell then work fine? I remain clueless!
August 12, 2020 at 7:53 pm
jonathan.crawford wrote:Michael L John wrote:So, getting my 8 and 10 year old grand kids to take showers during the Covid crisis has been tough. Today, after a lot of begging, the 8 year old finally goes and gets a shower.
I'm on my weekly Teams call with my boss, and a semi-naked wet little boy comes strolling up behind me. My boss lost it. He was laughing so hard he had to end the meeting.
hahaha....sounds familiar. "You need to take a shower"....."um, how about tomorrow" *finger guns*
Well, today was "I just took a shower". I asked when. He said 'When I was at grandmas". That was 4 days ago.
Got the opposite problem, have to shower before dawn as otherwise, our single bathroom is occupied.
😎
August 12, 2020 at 9:52 pm
Excel uses it’s own serial date system to store a date. Take a cell with a date in it and change the format to General. Time is decimal part of a day. Seem to recall it starting at 1900.
Reminds me of JDE and their version of Julian Dates.
Just wait - another Y2K type of event will happen.
August 12, 2020 at 10:14 pm
IIRC, there is also a difference in the dates in Excel and SQL Server. Only problem is that I don't quite remember what the problem, had I haven't had much luck with my google fu to find it.
August 12, 2020 at 10:29 pm
Excel: enable bad solutions
Access: implement bad solutions that require other bad solutions in order to function
PowerBI: Automate all the bad solutions with a bad process, and call it "data science"
I love Access, I can create giant disasters in a fraction of the time it usually takes me!
August 13, 2020 at 12:07 am
In nearly 30 years of using excel there are very few situations that don't have a straight forward work around.
built a report from an SQL database for a big international customer. The actual recipients of the report were their customers. So, the output was requested in the most common format - CSV.
Almost immediately they started complaining about incorrect account numbers in the report. Tirned out, 18 digit account numbers have been converted to float numbers while importing to Excel.
Can you suggest a workaround for this issue?
Apart from moving to Open Office?
_____________
Code for TallyGenerator
August 13, 2020 at 12:34 am
IIRC, there is also a difference in the dates in Excel and SQL Server. Only problem is that I don't quite remember what the problem, had I haven't had much luck with my google fu to find it.
Perhaps you are thinking of this?
1/1/1900 is 'day zero' in SQL Server, but 'day one' in Excel.
Here some T-SQL to back that up:
DECLARE @d DATETIME = '1900-01-01 00:00:00.000';
SELECT IntDate = CONVERT(INT, SUBSTRING(CONVERT(VARBINARY(8), @d), 1, 4));
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
August 13, 2020 at 12:44 am
Lynn Pettis wrote:IIRC, there is also a difference in the dates in Excel and SQL Server. Only problem is that I don't quite remember what the problem, had I haven't had much luck with my google fu to find it.
Perhaps you are thinking of this?
1/1/1900 is 'day zero' in SQL Server, but 'day one' in Excel.
Here some T-SQL to back that up:
DECLARE @d DATETIME = '1900-01-01 00:00:00.000';
SELECT IntDate = CONVERT(INT, SUBSTRING(CONVERT(VARBINARY(8), @d), 1, 4));
That is it, thank you.
August 13, 2020 at 2:30 am
Phil Parkin wrote:Lynn Pettis wrote:IIRC, there is also a difference in the dates in Excel and SQL Server. Only problem is that I don't quite remember what the problem, had I haven't had much luck with my google fu to find it.
Perhaps you are thinking of this?
1/1/1900 is 'day zero' in SQL Server, but 'day one' in Excel.
Here some T-SQL to back that up:
DECLARE @d DATETIME = '1900-01-01 00:00:00.000';
SELECT IntDate = CONVERT(INT, SUBSTRING(CONVERT(VARBINARY(8), @d), 1, 4));That is it, thank you.
Heh... although I don't run into it often anymore, the other problem is that Excel thinks that 1900 was a leap year unless you use the screw ball dates that have a base date of March 1st. It only has to happen once to have to know what the "work arounds" are.
--Jeff Moden
Change is inevitable... Change for the better is not.
August 13, 2020 at 8:35 am
Robert Sterbal wrote:In nearly 30 years of using excel there are very few situations that don't have a straight forward work around.
built a report from an SQL database for a big international customer. The actual recipients of the report were their customers. So, the output was requested in the most common format - CSV.
Almost immediately they started complaining about incorrect account numbers in the report. Tirned out, 18 digit account numbers have been converted to float numbers while importing to Excel.
Can you suggest a workaround for this issue?
Apart from moving to Open Office?
Only way I know is to put apostrophe before the number, it will appear when the file is loaded in excel but at least it will not be converted.
Far away is close at hand in the images of elsewhere.
Anon.
August 13, 2020 at 9:49 am
Lynn Pettis wrote:Phil Parkin wrote:Lynn Pettis wrote:IIRC, there is also a difference in the dates in Excel and SQL Server. Only problem is that I don't quite remember what the problem, had I haven't had much luck with my google fu to find it.
Perhaps you are thinking of this?
1/1/1900 is 'day zero' in SQL Server, but 'day one' in Excel.
Here some T-SQL to back that up:
DECLARE @d DATETIME = '1900-01-01 00:00:00.000';
SELECT IntDate = CONVERT(INT, SUBSTRING(CONVERT(VARBINARY(8), @d), 1, 4));That is it, thank you.
Heh... although I don't run into it often anymore, the other problem is that Excel thinks that 1900 was a leap year unless you use the screw ball dates that have a base date of March 1st. It only has to happen once to have to know what the "work arounds" are.
Did you run into those in your youth, the year looks about right 😉
😎
The last BIFF file format has two different date recordings, the Date1900 and the Date1904, 0 date is 1st of Jan 1900 and 1904 respectfully. This should not be relevant to the OOXML of the current versions, IIRC, dates are stored in the cells value section unless defined as strings, then they are moved to the internal text table and no formatting is applied. The problem with the text values is obvious, no date logic can be applied without type conversion.
Mind you, Excel is a pathological liar, often what is displayed has little resemblance to the actual value stored.
August 13, 2020 at 9:56 am
Robert Sterbal wrote:In nearly 30 years of using excel there are very few situations that don't have a straight forward work around.
built a report from an SQL database for a big international customer. The actual recipients of the report were their customers. So, the output was requested in the most common format - CSV.
Almost immediately they started complaining about incorrect account numbers in the report. Tirned out, 18 digit account numbers have been converted to float numbers while importing to Excel.
Can you suggest a workaround for this issue?
Apart from moving to Open Office?
Depends on the version of Excel, current versions are fully compatible with Open / Libre Office and can use the same file standard.
😎
August 13, 2020 at 10:10 am
Sergiy wrote:Robert Sterbal wrote:In nearly 30 years of using excel there are very few situations that don't have a straight forward work around.
built a report from an SQL database for a big international customer. The actual recipients of the report were their customers. So, the output was requested in the most common format - CSV.
Almost immediately they started complaining about incorrect account numbers in the report. Tirned out, 18 digit account numbers have been converted to float numbers while importing to Excel.
Can you suggest a workaround for this issue?
Apart from moving to Open Office?
Only way I know is to put apostrophe before the number, it will appear when the file is loaded in excel but at least it will not be converted.
that was the first thing I did - they were not quite satisfied.
Apostrophes had to be manually removed after importing, or all sorts of lookups they've been using would not work.
_____________
Code for TallyGenerator
Viewing 15 posts - 65,026 through 65,040 (of 66,738 total)
You must be logged in to reply to this topic. Login to reply