Friday, July 8, 2016

Mac Notes - Moving the Dock

I purchased my first ever computer (actually MacBook) with OS X under the advisement of a student counselor of an online school I'm attending now. I still love my PC laptops and desktops and will continue using them. I'm only using this laptop so that I can get used to the OS X environment in the event I go to work for someone that only has that platform.

The only thing I've done on it so far is go through my online course and install VPN software in case I ever need to remote into work.

Anyway, just going to start a list of notes mostly for my personal use. If it ends up helping someone else out, then great.

First topic, moving the dock from the bottom to the left side.

Launch System Preferences --> Dock

Then choose the radio button that suits your preference in the Position on Screen area.

Friday, March 18, 2016

Obtaining 3 month character representation of the month in Excel

Posting this for others and for myself in case I forget the next time I need to use it.

I'm trying to take a date in Excel and turn it into a 3 character representation.  I know how to do that using TSQL but others I work with that don't have access to TSQL tools and don't know how to script can also do some data formatting on their own.

I inserted the date...

3/18/2016

...in cell A1. In B1, I inserted what I thought the function would be but it didn't work...

=MONTH(A1)

This formula gave me a 3 in return instead of Mar. I was 99% sure that Excel had to have a function for this so after doing a Google search, I found what I was after and more.

 There was a post that stated to use this formula...

=TEXT(MONTH(A1),"MMM")

...but that gave me Jan in return which is not good because the date I keyed in was March. I found an explanation of what that combination of functions did. 

Using MONTH() only returns a number 1 through 12 depending on what date is in the cell. If you type in 1 in cell A1, 2 in A2 and all the way down to 12 in A12, convert that column to a date and you'll see that those are the first 12 dates in January of the year 1900.

If you have a number that includes or is between 1 through 12 in this formula...

=TEXT(6,"MMM")

...it's always going to return Jan as the month.  The fastest way to get the 3 character representation of month is just to use the TEXT() function and not the MONTH() function.

=TEXT(A1,"MMM")

Typing that function into cell A2 when the date (3/18/2016 for example) is in A1 will give...

Mar

After doing my Google search, it came to me that if I right clicked on a column that has dates, click on Format Cells... click on Custom, and then in the Type: field type MMM, that would give you the same result.

Thursday, February 25, 2016

Java Error 1603

I was getting the error 1603 for a few months when trying to update Java.  Then I decided it was time to dig into the problem.

My google searches weren't helping. To me, spending more than 15-20 minutes is a long time to search because normally the search results I get back explain how to fix issues usually within a few minutes.  I had spent 40-45 minutes trying to fix my issue.

I'm using Windows 7 (it's a work machine). Normally when I try and pass the buck by asking our (outsourced) help desk for help on issues I have with my machine, they go down the wrong path and sometimes they cause more issues.

I tried many different suggestions but none seemed to work. I had high hopes for these suggestions but they didn't work either...

http://java.com/en/download/help/error_1603.xml

I ended up taking suggestions from different forum posts and performing them in a different order to solve my issue with updating Java.

I uninstalled Java and couldn't reinstall. Forum posts kept telling me to reboot and reinstall Java but that 1603 error kept coming up.  I tried the 32-bit and the 64-bit offline installers as well.  Because I had uninstalled Java and the error kept coming up during the install, in my mind, I didn't have any Java files on my machine at all.

I came across a forum post that suggested to do a Start-->javacpl.exe     That's when it clicked that maybe some files were either left behind or some files made it back onto my computer during my repeated reinstall attempts. The suggestion was to start the Java control panel, click on the Security tab and deselect "Enable Java content in the browser" option.

After I did that, I close the control panel and searched to see if I had left over files from the 64-bit version reinstall attempts I performed.  I didn't see any so I then tried to install the offline Java installer and it finally worked.  After the install completed, I went back into the Java control panel and re-enabled "Enable Java content in the browser" option.

Thursday, February 18, 2016

SSRS adding extra page or white space when exporting to PDF

My employer has software that runs Crystal Reports (ver 9) out to PDF files every night to a shared network drive.  I've been tasked with converting all of those reports over to SSRS and by using the subscriptions to generate these reports. When I started with my first report and did an export out to a PDF file, it kept adding extra blank pages at the end.

Here are the specs of my environment...
1. SSRS 2008 (installed directly on the db server)
2. Report Builder 3.0
3. Windows 7 workstation

From previous experience I knew that I couldn't expand the body of the report out past a certain point but I couldn't remember what that was.  I expanded the width out to 8.5 and I didn't touch the margins.  After playing around with the margins and the body width, I found out that I had to take the body width and subtract that by both the left and right margins and if it was greater than 8.5, it was going to push white space onto a page that should show up to the side of it but it looked like the next page.

So, in short, to keep extra white space from showing up at the bottom of an SSRS report, take the body width subtract left margin subtract right margin which should be less than or equal to whatever you would be printing to...in my case to a PDF.

Monday, November 24, 2014

Drag and Drop quits working in Windows 7

I don't use applications that require drag and drop functionality too much. I would say that most of my drag and drop activities occur when I'm working with SSIS and I'm creating packages to move data around.

From time to time I lose the ability to drag and drop...anything.  I can't copy files from one place to another. I can't even move messages from my Outlook Inbox to another folder.  My solution up until about 5 minutes ago was to reboot and I would get my drag and drop capability back.  I found a forum post from someone named Prophet Zarquon. I'm going to slightly modify his posted suggestion.

1)  Find any icon/file (create a blank file if you want to on your desktop).
2)  Because I'm no expert on keystroke combinations I wasn't sure what clicking while holding escape did, I created a blank text file on my desktop. Click and HOLD the icon with the Left mouse button.
3)  Press Esc while holding down the Left mouse button.

Here's the link to the forum post (as of 11-24-2014) I found if you care to see backup on this information.

http://answers.microsoft.com/en-us/windows/forum/windows_7-files/suddenly-cant-drag-or-drop-files-anymore-in/10278f8c-08bb-4630-8a79-15e4a1ac0701

I decided this was post worthy in case the above link ever disappears and in case I forget the keystroke sequence again I can refer back to this post.

Monday, August 11, 2014

Showing date as MM/DD/YYYY in PL/SQL

Up until now, I've always left the date format for pulling data out of a clinic system as YYYY-MM-DD HH24:MI:SS when working with Toad for Oracle.  I don't always change the format but I'm finding that I'm having to change it more and more often after exporting to Excel to MM/DD/YYYY because the time of day isn't needed.


I tried to make it work on my own using the TO_DATE() function but kept getting the error...


ORA-01843: not a valid month


I'm believe it has to do with the leading zero at the beginning of most months.  Instead of using TO_DATE(table.field, 'MM/DD/YYYY') I found out that I should use TO_CHAR(table.field, 'MM/DD/YYYY').


What a simple fix. I was trying to make it harder than it was with the different combinations I was trying.


Yes I know this is kids stuff but when you have never had to convert a date format and it all of the sudden it would take a few manual steps away if you did, it's handy to document it somewhere.

Friday, August 1, 2014

I work with an application called Toad for Oracle. All I use it for are custom reports and to copy 12 tables out of our database once a month for a project I'm working on. I have on occasion used it to trace the SQL taking place behind the scenes on different canned reports.

After playing around with the export settings, the fastest way to get data out of these tables thus far has been to export to MS Access files.  I would save them locally and then after completing that task, I move them to a server on the network.

This server on the network is my playground so to speak.  It has MS SQL 2012 installed along with all the SQL suite of tools. This is where I'm going to develop a database to de-normalize the data for the purposes of custom reporting. The database that I'm pulling this from was designed in a very bad way. If you try and use the SUM() function on one of the fields containing money amounts, it could take 18 hours to finish.

Anyway, after logging into this server (my login is a domain admin and I have admin rights on this server), I tried opening up one of the MS Access files and I got the following error...

The version of Access used to save this database cannot be detected. this problem cannot be corrected because the database is read-only. Click OK, and after the database closes, make a backup copy of the database. Then open the database with read/write permission.






These files are *.accdb files and I believe Toad for Oracle exports into a 2007 format. The files are on the local E:\ drive. I'm using Access 2013 on that server.  Googling that error pointed me to forum posts that explained issues that were somewhat similar but not completely. They talked about not having the rights to the directory the files are located in but I knew that couldn't be right since I have admin rights and I use the same login to transfer the files as I am trying to open the files.

Just for kicks, I copied the file from one directory to another and I was finally able to open the file.