Tuesday, June 7, 2011

Remove weekend days from list of days MS access

One of the things that I faced, was how to remove the weekend dates from a list of days.
The solution was simple.
use the function:
DatePart 
This function is fully listed in the following link:
http://www.techonthenet.com/access/functions/date/datepart.php

What I did is the following to remove Sunday and Saturday.
the DatePart returns a number between 1(Sunday)-7 (Saturday)
so I did:
where DatePart("w",(DayColumnInDays.MM/DD/YYYY))<=6 And DatePart("w",(DayColumnInDays.MM/DD/YYYY))>1

This is how I removed the weekends

Wednesday, June 1, 2011

Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (latin1_general_ci,IMPLICIT)

This is a very common problem that you might run in at all times.
To over come it, do the following:
1- Open MySQL Query browser
2- Go to the first table you are facing a problem with.
3- right click and hit "Edit Table" OR hit (F2) for a short cut
4- click on the variable you have a problem with from the "Column Name"
5- Go to "Column Details" Tab
6- On the far right you will see the "Column Collate:" switch it to the default value you want (either swedish or general)
7- Do the same with the Other table
And that is it