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
-
I honestly love this cooler, but I think I'm gonna move on to another one soon, it just looks... A bit to bland compared to other flaming red (literally) coolers on the market.
-
Metro 2033 is one of the greatest FPS games ever made. Although not usually recognized as such, due to the horrible state the gaming industry is in, it succeeds largely on its storytelling,...
-
This is an update of the original Fractal Design Arc Midi. The solid left panel has been replaced by a panel with a plexiglass window and the top USB ports are now USB-3.0. Let me state at the...
-
I've used this headset extensively for MAG on PS3. The sounds were wonderful, the mic was crisp, and the ability to adjust peoples voice volume is absolutely invaluable. For $100 ( or less ) this...
-
The Pros The reason this card is one of the better non-Tahiti 7870s is because of Gigabyte's custom PCB. Gigabyte took the 7870 and replaced it's memory chips with Hynix memory so they perform a...
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,757
- Rep: 791 (Unique: 384)
- 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,757
- Rep: 791 (Unique: 384)
- 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 2321 Active Users
(779 Members and 1542 Guests)
Recent Discussions
- › Nvidia GeForce GTX TITAN Owners' club 6 seconds ago
- › MLP Game Day Thread - May 31st to June 1st 7 seconds ago
- › [Various] GTX 780 Reviews 11 seconds ago
- › [Anand] The Xbox One: Hardware Analysis & Comparison to PlayStation 4 14 seconds ago
- › FAQ: PhysX 18 seconds ago
- › GTA - ProReal Mod RELEASE 27 seconds ago
- › Overclock 3770k Cand do it ! WHY ? 29 seconds ago
- › 3770K temps 31 seconds ago
- › DDR3 1600 vs 2133 is there a difference in game? 41 seconds ago
- › I5/I7 1155 or 2011 for gtx690 58 seconds ago
View: New Posts | All Discussions
Recent Reviews
- › Cooler Master Hyper 212 EVO CPU Cooler (RR-212E-20PK-R1) by junhawng
- › Metro: Last Light - Standard Edition by boredgunner
- › Fractal Design Arc Midi R2 FD-CA-ARC-R2-BL-W Computer Case With... by Alan G
- › Wireless Stereo Headset by DoomDash
- › GIGABYTE Radeon HD 7870 GHz Edition GV-R787OC-2GD Video Card by VitalShot
- › Crucial Ballistix sport 16GB (2 x 8GB) 240-Pin DDR3 SDRAM DDR3 1600... by Fieldsweeper
- › Creative 70SB150000000 Sound Card by Fieldsweeper
- › ASUS PB Series PB278Q 27"" 5ms (GTG) WQHD Widescreen LED... by R3apR369
- › SilverStone Aluminum Body ATX Full Tower Computer Case TJ07B -... by R3apR369
- › Cooler Master HAF 922 RC-922M-KKN1-GP Black Steel + Plastic and... by Steve1300
View: More Reviews
New Articles
- › Rackmount Storage Devices for your mypccase by chriseddins
- › Online free image resizer by morgan0021
- › Maid Service Stroud by jacob5564
- › 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
- › How to take ownership of a file, folder, or... by exzacklyright
- › How to disable the open file security warning... by exzacklyright
- › Clean and Make a USB Bootable Flash Drive for... 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





