Monday, October 21, 2013

Extract Month/Year from dates in Oracle

This is how to extract month or year from Oracle (placing it here so I don't forget)

By Month -
SELECT EXTRACT(month FROM order_date) "Month",
  COUNT(order_date) "No. of Orders"
  FROM orders
  GROUP BY EXTRACT(month FROM order_date)
  ORDER BY "No. of Orders" DESC;


By Year -
SELECT EXTRACT(YEAR FROM DATE '1998-03-07') FROM DUAL;


For more info, look at this page:
http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions050.htm


See PDF for more SQL References:
http://docs.oracle.com/cd/B19306_01/server.102/b14200.pdf

Tuesday, September 24, 2013

Microsoft Access 2007 - VBA functions breaks with missing reference

I have had some issues with applications written in Microsoft Access 2007. I was wondering why all of a sudden this functions will break and would have missing references. Had a bit of research on this error and find this URL from Microsoft :

Visual Basic for Applications (VBA) functions break in a database with missing references


The resolution the page had to remove the missing reference is to follow these steps:
  1. Open your database.
  2. Press ALT+F11 to open the Visual Basic Editor.
  3. On the Tools menu, click References.
  4. Click to clear the check box for the type library or object library marked as MISSING: .