Forum Moderators: open
What I want to do, is to make a query which reads records from goal_student Table and divide them in terms of weeks, i.e. Week 1, Week 2, Week 3 ......
The question is
How I can do it, using the datetime field which stores the exact time of choosing a goal.
The structure of all the tables are as follows.
------------------------------------------------------------
CREATE TABLE `goal` (
`goal_id` int(11) NOT NULL auto_increment,
`active` tinyint(1) unsigned NOT NULL default '0',
`details` blob NOT NULL,
`title` varchar(255) NOT NULL,
`goal_type` varchar(255) NOT NULL,
PRIMARY KEY (`goal_id`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
------------------------------------------------------------
CREATE TABLE `goal_strategy` (
`goal_strategy_id` int(10) unsigned NOT NULL auto_increment,
`goal_id` int(10) unsigned NOT NULL,
`strategy` varchar(255) NOT NULL,
PRIMARY KEY (`goal_strategy_id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=latin1;
------------------------------------------------------------
CREATE TABLE `goal_student` (
`goal_student_id` int(10) unsigned NOT NULL auto_increment,
`goal_id` int(10) unsigned NOT NULL default '0',
`userid` varchar(12) NOT NULL default '0',
`start_date` datetime NOT NULL default '0000-00-00 00:00:00',
`curStatus` varchar(45) NOT NULL default '',
`strategy_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`goal_student_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
------------------------------------------------------------