hi,how am i going to select the records per week? example i want to select the 1st week of july where the start date is sunday?this is for my weekly report but i dont know how to start it. i can post my code here for getting the records daily if it is possible to use for weekly:
Dim dt As Date = DateTimePicker1.Text
If ComboBox1.Text = "Central Reservation Report" Then
If RadioButton1.Checked = True Then
CheckBox1.Enabled = False
Dim rpt As New rsvD() 'The report you created.
Dim MyCommand As New SqlCommand()
Dim myDS As New DScentralrsv() 'The DataSet you created.
Dim myDA As New SqlDataAdapter()
Dim cn As New SqlConnection(ConnectString())
MyCommand.Connection = cn
MyCommand.CommandText = "Select irsno,date,industry,totalamount from maintable where date='" + dt + "'"
MyCommand.CommandType = CommandType.Text
myDA.SelectCommand = MyCommand
MyCommand.CommandText = "Select irsno from roomtbl"
myDS.EnforceConstraints = False
CrystalReportViewer1.ReportSource = rpt
Catch Excep As Exception
MessageBox.Show(Excep.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)