Hey guys, I'm no SQL master, I need a bit of help changing a column in our database. So we have a database named "Connect" and the column I need to change is in the "Study" table, with the column name being "Study_Duplicated". So we also have another column in the study table that is called "Study_date". The only digits that can go into the "Study_Duplicated" table is 1 or 0. 1 meaning it has been duplicated and 0 meaning the study has not been duplicated. I need to change the column to 1 for a particular date range. Say I want to make everything prior to 3/27/12 set to "Study_Duplicated = 1". What would the syntax be to modify a columns contents? Our dates are structured as Year/Month/Day (20120730). If someone can help me with this it would be greatly appreciated! Also, I am using SQL 2005 standard.
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › SQL 2005 query help needed.
Featured Sponsors
Recent Reviews
-
Price reviewed: £16 After reviewing the Anker 8000DPI Gaming mouse - I was intrigued how the 2000DPI one compared. Here is my review for the 8K DPI one:...
-
£10, 2000 DPI, excellent design, elegant and a tiny USB for connectivity. What else could you ask for? This mouse is brilliant in all aspects! Really love using it as a on-the-go mouse! The USB...
-
This is my "quick review", I'll go more in-depth soon... Been running this kit for some time, having originally purchased it in late March/early April of 2012. When I bought it, I expected a kit...
-
This is a very nice and fast CPU... I see various reports on temperature, but mine runs cool at 4.5 GHz and rock solid doing BOINC tasks 24/7. Nothing but good things to say about this processor. I...
-
Story : You play as the legendary beast hunter Van Helsing trying to hunt monsters, help the innocent civilians and hunt down the menace upon Borgovia. Graphics : As a game similar...
SQL 2005 query help needed.
post #2 of 5
7/30/12 at 8:44am
- tompsonn
- The debug-inator
-





- Joined: Aug 2011
- Location: Australia
- Posts: 6,803
- Rep: 795 (Unique: 387)
- Select All Posts By This User
UPDATE {table_name} SET Study_Duplicated = 1 WHERE {some complicated expression to fit your weird date representation in a DB}
My System
(30 items) |
"Zeus"
(13 items) |
| CPU | Motherboard | Graphics | RAM |
|---|---|---|---|
| Intel Core i5 2500K (4.5ghz @ 1.320v) | Gigabyte Z68X-UD3R-B3 | MSI R7970 Lightning | Corsair 16GB (4x4GB) |
| Hard Drive | Hard Drive | Hard Drive | Hard Drive |
| Plextor PX-256M5S 256GB | Crucial M4 128GB | Hitachi HDS721010CLA332 | Hitachi HDS723020BLA642 |
| Hard Drive | Hard Drive | Hard Drive | Optical Drive |
| Hitachi HDS723020BLA642 | Hitachi HUA722010CLA330 | WDC WD10EARS-00Z5B1 | TSSTcorp CDDVDW SH-S223B |
| Cooling | Cooling | OS | Monitor |
| Phanteks PH-TC14PE with TY-140's | Lamptron FCv5 (x2) | Windows 7 Ultimate 64-bit | Dell U2412M |
| Monitor | Monitor | Monitor | Keyboard |
| Dell U2412M | Dell U2212HM | Dell U2212HM | Ducky DK9087 G2 Pro |
| Power | Case | Mouse | Mouse Pad |
| Corsair AX-750 | Corsair Obsidian 650D | Microsoft IntelliMouse Optical | XTRAC Ripper XXL |
| Audio | Audio | Audio | Audio |
| Westone W3 IEMs | RE-272 IEMs | Shure SE-215 IEMs | Schiit Bifrost DAC |
| Audio | Audio | ||
| Schiit Asgard 2 amp | HiVi Swan M50W 2.1 | ||
| View all | |||
| CPU | Motherboard | Graphics | RAM |
|---|---|---|---|
| Intel Core i7 950 | GA-X58-UD3R | Radeon HD 5450 | 24GB Corsair @ 1333mhz |
| Hard Drive | OS | Power | Case |
| 4x WD Cavair Red 1TB in RAID 0 | Windows Server 2008 R2 x64 | Corsair HX-520 | LianLi LanCool |
| View all | |||
My System
(30 items) |
"Zeus"
(13 items) |
| CPU | Motherboard | Graphics | RAM |
|---|---|---|---|
| Intel Core i5 2500K (4.5ghz @ 1.320v) | Gigabyte Z68X-UD3R-B3 | MSI R7970 Lightning | Corsair 16GB (4x4GB) |
| Hard Drive | Hard Drive | Hard Drive | Hard Drive |
| Plextor PX-256M5S 256GB | Crucial M4 128GB | Hitachi HDS721010CLA332 | Hitachi HDS723020BLA642 |
| Hard Drive | Hard Drive | Hard Drive | Optical Drive |
| Hitachi HDS723020BLA642 | Hitachi HUA722010CLA330 | WDC WD10EARS-00Z5B1 | TSSTcorp CDDVDW SH-S223B |
| Cooling | Cooling | OS | Monitor |
| Phanteks PH-TC14PE with TY-140's | Lamptron FCv5 (x2) | Windows 7 Ultimate 64-bit | Dell U2412M |
| Monitor | Monitor | Monitor | Keyboard |
| Dell U2412M | Dell U2212HM | Dell U2212HM | Ducky DK9087 G2 Pro |
| Power | Case | Mouse | Mouse Pad |
| Corsair AX-750 | Corsair Obsidian 650D | Microsoft IntelliMouse Optical | XTRAC Ripper XXL |
| Audio | Audio | Audio | Audio |
| Westone W3 IEMs | RE-272 IEMs | Shure SE-215 IEMs | Schiit Bifrost DAC |
| Audio | Audio | ||
| Schiit Asgard 2 amp | HiVi Swan M50W 2.1 | ||
| View all | |||
| CPU | Motherboard | Graphics | RAM |
|---|---|---|---|
| Intel Core i7 950 | GA-X58-UD3R | Radeon HD 5450 | 24GB Corsair @ 1333mhz |
| Hard Drive | OS | Power | Case |
| 4x WD Cavair Red 1TB in RAID 0 | Windows Server 2008 R2 x64 | Corsair HX-520 | LianLi LanCool |
| View all | |||
- charlesC8188
- Networking Nut
- Joined: Nov 2010
- Location: Pittsburgh, PA
- Posts: 438
- Rep: 20 (Unique: 18)
- Trader Rating: 7
- Select All Posts By This User
Quote:
I tried running
use connect
update {study}
SET study_duplicated = 1
where study_date > '20000101' and study_date < '20120101'
and got
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near '}'.
=/ Thanks for the try though.
Gaming Rig
(14 items) |
| CPU | Motherboard | Graphics | RAM |
|---|---|---|---|
| Intel 2500K @ 4.3Ghz 1.27V | ASRock Z68 Extreme4 Gen3 LGA 1155 Intel Z68 | Asus HD 7970 1225/1675 @ 1.2V | G.SKILL Sniper Series DDR3 2133 (2 x 4GB) 9-11-... |
| Hard Drive | Optical Drive | Cooling | OS |
| Kingston SSD (80GB) | CD/DVD/BD Drive/burner | Antec Kuhler H2O 620 | Windows 7 Ultimate, openSUSE x64 |
| Monitor | Power | Case | |
| ASUS VS248H-P Black 24" 2ms x3 5760x1080 | ThermalTake Black Widow 850Watt | Antec 900 2 | |
| View all | |||
Gaming Rig
(14 items) |
| CPU | Motherboard | Graphics | RAM |
|---|---|---|---|
| Intel 2500K @ 4.3Ghz 1.27V | ASRock Z68 Extreme4 Gen3 LGA 1155 Intel Z68 | Asus HD 7970 1225/1675 @ 1.2V | G.SKILL Sniper Series DDR3 2133 (2 x 4GB) 9-11-... |
| Hard Drive | Optical Drive | Cooling | OS |
| Kingston SSD (80GB) | CD/DVD/BD Drive/burner | Antec Kuhler H2O 620 | Windows 7 Ultimate, openSUSE x64 |
| Monitor | Power | Case | |
| ASUS VS248H-P Black 24" 2ms x3 5760x1080 | ThermalTake Black Widow 850Watt | Antec 900 2 | |
| View all | |||
- charlesC8188
- Networking Nut
- Joined: Nov 2010
- Location: Pittsburgh, PA
- Posts: 438
- Rep: 20 (Unique: 18)
- Trader Rating: 7
- Select All Posts By This User
Nevermind, I removed the {} and it worked. Thank you very much! +Rep
Gaming Rig
(14 items) |
| CPU | Motherboard | Graphics | RAM |
|---|---|---|---|
| Intel 2500K @ 4.3Ghz 1.27V | ASRock Z68 Extreme4 Gen3 LGA 1155 Intel Z68 | Asus HD 7970 1225/1675 @ 1.2V | G.SKILL Sniper Series DDR3 2133 (2 x 4GB) 9-11-... |
| Hard Drive | Optical Drive | Cooling | OS |
| Kingston SSD (80GB) | CD/DVD/BD Drive/burner | Antec Kuhler H2O 620 | Windows 7 Ultimate, openSUSE x64 |
| Monitor | Power | Case | |
| ASUS VS248H-P Black 24" 2ms x3 5760x1080 | ThermalTake Black Widow 850Watt | Antec 900 2 | |
| View all | |||
Gaming Rig
(14 items) |
| CPU | Motherboard | Graphics | RAM |
|---|---|---|---|
| Intel 2500K @ 4.3Ghz 1.27V | ASRock Z68 Extreme4 Gen3 LGA 1155 Intel Z68 | Asus HD 7970 1225/1675 @ 1.2V | G.SKILL Sniper Series DDR3 2133 (2 x 4GB) 9-11-... |
| Hard Drive | Optical Drive | Cooling | OS |
| Kingston SSD (80GB) | CD/DVD/BD Drive/burner | Antec Kuhler H2O 620 | Windows 7 Ultimate, openSUSE x64 |
| Monitor | Power | Case | |
| ASUS VS248H-P Black 24" 2ms x3 5760x1080 | ThermalTake Black Widow 850Watt | Antec 900 2 | |
| View all | |||
post #5 of 5
7/30/12 at 8:57pm
- tompsonn
- The debug-inator
-





- Joined: Aug 2011
- Location: Australia
- Posts: 6,803
- Rep: 795 (Unique: 387)
- Select All Posts By This User
No worries, sorry should have mentioned the braces were just placeholders 

My System
(30 items) |
"Zeus"
(13 items) |
| CPU | Motherboard | Graphics | RAM |
|---|---|---|---|
| Intel Core i5 2500K (4.5ghz @ 1.320v) | Gigabyte Z68X-UD3R-B3 | MSI R7970 Lightning | Corsair 16GB (4x4GB) |
| Hard Drive | Hard Drive | Hard Drive | Hard Drive |
| Plextor PX-256M5S 256GB | Crucial M4 128GB | Hitachi HDS721010CLA332 | Hitachi HDS723020BLA642 |
| Hard Drive | Hard Drive | Hard Drive | Optical Drive |
| Hitachi HDS723020BLA642 | Hitachi HUA722010CLA330 | WDC WD10EARS-00Z5B1 | TSSTcorp CDDVDW SH-S223B |
| Cooling | Cooling | OS | Monitor |
| Phanteks PH-TC14PE with TY-140's | Lamptron FCv5 (x2) | Windows 7 Ultimate 64-bit | Dell U2412M |
| Monitor | Monitor | Monitor | Keyboard |
| Dell U2412M | Dell U2212HM | Dell U2212HM | Ducky DK9087 G2 Pro |
| Power | Case | Mouse | Mouse Pad |
| Corsair AX-750 | Corsair Obsidian 650D | Microsoft IntelliMouse Optical | XTRAC Ripper XXL |
| Audio | Audio | Audio | Audio |
| Westone W3 IEMs | RE-272 IEMs | Shure SE-215 IEMs | Schiit Bifrost DAC |
| Audio | Audio | ||
| Schiit Asgard 2 amp | HiVi Swan M50W 2.1 | ||
| View all | |||
| CPU | Motherboard | Graphics | RAM |
|---|---|---|---|
| Intel Core i7 950 | GA-X58-UD3R | Radeon HD 5450 | 24GB Corsair @ 1333mhz |
| Hard Drive | OS | Power | Case |
| 4x WD Cavair Red 1TB in RAID 0 | Windows Server 2008 R2 x64 | Corsair HX-520 | LianLi LanCool |
| View all | |||
My System
(30 items) |
"Zeus"
(13 items) |
| CPU | Motherboard | Graphics | RAM |
|---|---|---|---|
| Intel Core i5 2500K (4.5ghz @ 1.320v) | Gigabyte Z68X-UD3R-B3 | MSI R7970 Lightning | Corsair 16GB (4x4GB) |
| Hard Drive | Hard Drive | Hard Drive | Hard Drive |
| Plextor PX-256M5S 256GB | Crucial M4 128GB | Hitachi HDS721010CLA332 | Hitachi HDS723020BLA642 |
| Hard Drive | Hard Drive | Hard Drive | Optical Drive |
| Hitachi HDS723020BLA642 | Hitachi HUA722010CLA330 | WDC WD10EARS-00Z5B1 | TSSTcorp CDDVDW SH-S223B |
| Cooling | Cooling | OS | Monitor |
| Phanteks PH-TC14PE with TY-140's | Lamptron FCv5 (x2) | Windows 7 Ultimate 64-bit | Dell U2412M |
| Monitor | Monitor | Monitor | Keyboard |
| Dell U2412M | Dell U2212HM | Dell U2212HM | Ducky DK9087 G2 Pro |
| Power | Case | Mouse | Mouse Pad |
| Corsair AX-750 | Corsair Obsidian 650D | Microsoft IntelliMouse Optical | XTRAC Ripper XXL |
| Audio | Audio | Audio | Audio |
| Westone W3 IEMs | RE-272 IEMs | Shure SE-215 IEMs | Schiit Bifrost DAC |
| Audio | Audio | ||
| Schiit Asgard 2 amp | HiVi Swan M50W 2.1 | ||
| View all | |||
| CPU | Motherboard | Graphics | RAM |
|---|---|---|---|
| Intel Core i7 950 | GA-X58-UD3R | Radeon HD 5450 | 24GB Corsair @ 1333mhz |
| Hard Drive | OS | Power | Case |
| 4x WD Cavair Red 1TB in RAID 0 | Windows Server 2008 R2 x64 | Corsair HX-520 | LianLi LanCool |
| View all | |||
Return Home
Back to Forum: Coding and Programming
- SQL 2005 query help needed.
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › SQL 2005 query help needed.
Currently, there are 1602 Active Users
(412 Members and 1190 Guests)
Recent Discussions
- › i need help with my hp small for factor im stuck 1 minute ago
- › [Kotaku] Steam might soon let you share your games with your friends 1 minute ago
- › [Nerd Reactor] Don't update your PS3 1 minute ago
- › [TPU] EVGA SuperNOVA 1300 G2 Power Supply Announced 3 minutes ago
- › [Official] Diablo III Information and Discussion Thread 3 minutes ago
- › [Kotaku] Sony Actually Has A Very Different Future In Mind For... 3 minutes ago
- › problem with sapphire HD 7970 dual-x oc {factory oc version} 4 minutes ago
- › [GS] - Dota 2 to be released this summer 5 minutes ago
- › OCN Water Cooling Club And Picture Gallery 5 minutes ago
- › A piece fell off my z77 extreme4 5 minutes ago
View: New Posts | All Discussions
Recent Reviews
- › Anker Laser Gaming Mouse with 2000DPI, 7 Programmable Button, 5... by Totally Dubbed
- › Anker Wireless Mouse, 3 Adjustable DPI Levels, 2000 DPI, 6 Buttons,... by Totally Dubbed
- › 16GB G.Skill DDR3 PC3-17000 RipjawsZ Series for Intel X79... by nleksan
- › Intel Core i5-3570K 3.4GHz LGA1155 by Tex1954
- › The Incredible Adventures of Van Helsing by iARDAs
- › Skyworth 39E780U UHD tv by maarten12100
- › S.T.R.I.K.E. 7 Gaming Keyboard for PC by hatlesschimp
- › Corsair Obsidian 350D by Oliver1234
- › CrossOver BLACK TUNE 2735AMG IPS LED by RSMJR87
- › Samsung 840 PRO Series MZ-7PD256 256GB 2.5-inch SSD by Drpillz624
View: More Reviews
New Articles
- › ASUS ROG Poseidon by Amar
- › ASUS Transformer Book Trio : a weird Combination by Amar
- › FreeBSD HTPC and Home Server by CaptainBlame
- › Can AMD hardware in New Consoles leverage... by Amar
- › The Future of PC Gaming .. by dava4444
- › GTX 780 Overclocking! by Amar
- › METRO 2033 STARTUP CRASH FIX WORKS by xiangelo
- › Why are DNS Servers Important? How to make... by exzacklyright
- › Titanium Backup Guide For Newbies by exzacklyright
- › How to install ADB (Android Debug Bridge) by exzacklyright
View: New Articles | All Articles
Home | Reviews | Forums | Articles | My Profile
About Overclock.net | Join the Community | Advertise | Contact Us | All Staff
© 2013 Shogun Interactive Development Overclock.net is powered by Huddler Tech | FAQ | Support | Privacy | ToS | DMCA | Site Map
About Overclock.net | Join the Community | Advertise | Contact Us | All Staff
© 2013 Shogun Interactive Development Overclock.net is powered by Huddler Tech | FAQ | Support | Privacy | ToS | DMCA | Site Map





