chanlichin
New member
- Joined
- Aug 24, 2009
- Messages
- 2
- Programming Experience
- Beginner
Hi, I am now want to retrieve only year from my table(summary),field name(dates). So i am facing the problem on how to display the year in combo Box. my sql statement as below. Thanks 
If i put SELECT DATES, that means day,month and year will display. So, what should i put after SELECT
	
	
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
	
		
			
		
		
	
				
			If i put SELECT DATES, that means day,month and year will display. So, what should i put after SELECT
			
				VB.NET:
			
		
		
		      sql = "SELECT dates FROM summary WHERE plants = '" & yieldsummary.cbPlant.Text & "'"
            da = New OleDb.OleDbDataAdapter(sql, con)
            da.Fill(ds, "summary")
            con.Close()
            maxrow = ds.Tables("summary").Rows.Count
            For x = 0 To maxrow - 1
                cbYear.Items.Add(ds.Tables("summary").Rows(x).Item("dates"))
                cbYear1.Items.Add(ds.Tables("summary").Rows(x).Item("dates"))
            Next x 
	 
 
		 
 
		 
 
		 
 
		