Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Date Question

Author  Topic 

vk18
Posting Yak Master

146 Posts

Posted - 2006-10-10 : 16:59:50
Hello Friends
I have a dropdown box which contains the dates from 1-1-2000 to 12-1-2006. And also I have a column in a table tblmonths called
"Scheduleddate". This Scheduleddate column has dates from 2-1-2000, 2-2-2000, 2-3-2000 and so on up to 12-31-2006.

If i Pick the Dropdown lets say 3-1-2003 then i need to update the rest of the fields in the table tblmonths which has dates
in the field Scheduleddate from 3-1-2003 to 3-31-2003 not all of them. I know updating the table. how to check this condition..? Can you guys help me with code when i pick the date in the drop down
then i need to update the table only for that month. I am using VB.NET/ASP.NET. Any Ideas..?
Thx

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-10-10 : 17:07:44
UPDATE tblMonths
SET ScheduledDate = <something>
where datepart(year, ScheduledDate) = datepart(year, @pickdate) and datepart(month, ScheduledDate) = datepart(month, @pickdate)


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

vk18
Posting Yak Master

146 Posts

Posted - 2006-10-10 : 17:22:21
Hi,

Actually i did updated my question, please see above
Thx
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-10-10 : 17:23:31
Actually I wrote the condition too you are searching for.
Look what is written in the WHERE clause.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

vk18
Posting Yak Master

146 Posts

Posted - 2006-10-10 : 18:05:20
quote:
Originally posted by Peso

Actually I wrote the condition too you are searching for.
Look what is written in the WHERE clause.


Peter Larsson
Helsingborg, Sweden


Hi,
I did not understand, can you explain me clearly..?
THX
Go to Top of Page

vk18
Posting Yak Master

146 Posts

Posted - 2006-10-10 : 19:30:12
Got Another Idea never mind
Thx
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-10-11 : 00:50:48
You're welcome and good luck.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -