Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
neogeo0823
Jul 4, 2007

NO THAT'S NOT ME!!

I'm interested if the price is reasonable. Being forever broke sucks.

Adbot
ADBOT LOVES YOU

Aunt Beth
Feb 24, 2006

Baby, you're ready!
Grimey Drawer
Count me in for a flash drive. I'd love a physical reminder of all the time I waste on here.

22 Eargesplitten
Oct 10, 2010



neogeo0823 posted:

I'm interested if the price is reasonable. Being forever broke sucks.

Same. Possibly interested depending on how much it is.

Malek
Jun 22, 2003

Shut up Girl!
And as always: Kill Hitler.
Does the USB Stick say "And Revert" on the other side?

kensei
Dec 27, 2007

He has come home, where he belongs. The Ancient Mariner returns to lead his first team to glory, forever and ever. Amen!


Malek posted:

Does the USB Stick say "And Revert" on the other side?

I vote for 'revert back' because I hear that way too often

Thanks Ants
May 21, 2004

#essereFerrari


Rather than shipping from the US and dealing with that, it might be worth an EU goon opting to service the people interested from a different supplier.

http://www.flashbay.co.uk/usb-sticks/pop

spog
Aug 7, 2004

It's your own bloody fault.

Thanks Ants posted:

Rather than shipping from the US and dealing with that, it might be worth an EU goon opting to service the people interested from a different supplier.

http://www.flashbay.co.uk/usb-sticks/pop

A good idea, as long as the quantity works:

http://www.pinklizardpromotions.co.uk/product/USB_16GB_Flash_Drive_Twister_614117

About £10 each (plus postage, say £2), as long as you order at least 25 pieces

Paladine_PSoT
Jan 2, 2010

If you have a problem Yo, I'll solve it

Malek posted:

Does the USB Stick say "And Revert" on the other side?



Always open to new designs though

nullfunction
Jan 24, 2005

Nap Ghost
In for at least two or three.

Samizdata
May 14, 2007
Depending on whether or not I have a gift card (as I don't have plastic) and price, count me in.

Dick Trauma
Nov 30, 2007

God damn it, you've got to be kind.

kensei posted:

I vote for 'revert back' because I hear that way too often

"please help"
"i need this to work"
"kindly advise"

Nerdrock
Jan 31, 2006

"I need this TO DO MY JOB"

TITTIEKISSER69
Mar 19, 2005

SAVE THE BEES
PLANT MORE TREES
CLEAN THE SEAS
KISS TITTIESS




THIS IS AFFECTING PRODUCTION

The Muffinlord
Mar 3, 2007

newbid stupie?

Wilford Cutlery posted:

THIS IS AFFECTING PRODUCTION PATIENT CARE
I really need to get out of healthcare IT.

TWBalls
Apr 16, 2003
My medication never lies

The Muffinlord posted:

Wilford Cutlery posted:

THIS IS AFFECTING PRODUCTION PATIENT CARE

I really need to get out of healthcare IT.

Me too. :suicide:

Proteus Jones
Feb 28, 2013



Wilford Cutlery posted:

THIS IS AFFECTING PRODUCTION

IT HAS BEEN LIKE THIS FOR MONTHS

uPen
Jan 25, 2010

Zu Rodina!

Proteus Jones posted:

IT HAS BEEN LIKE THIS FOR MONTHS

If you told me about it today it happened today.

First of May
May 1, 2017
🎵 Bring your favorite lady, or at least your favorite lay! 🎵


A request to update an old report came in...

Evidently, my predecessor wrote this bit of SQL for a previous-year-to-date clause.
code:
PostDate BETWEEN DATEADD(yy,-1, DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), 0)) AND DATEADD(yy, -1, GETDATE())
Now, SQL isn't exactly my first language, but there's got to be a better way to do that, right?

ChubbyThePhat
Dec 22, 2006

Who nico nico needs anyone else

First of May posted:

A request to update an old report came in...

Evidently, my predecessor wrote this bit of SQL for a previous-year-to-date clause.
code:
PostDate BETWEEN DATEADD(yy,-1, DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), 0)) AND DATEADD(yy, -1, GETDATE())
Now, SQL isn't exactly my first language, but there's got to be a better way to do that, right?

If all you want is the current year to date (Jan.1 20XX to whatever day today is) I think you only need:
code:
Where someVar BETWEEN DATEADD(yy, DATEDIFF(yy,0,GETDATE()),0) AND GETDATE()
From your post, it looks like he's pulling the calendar year for the previous year (ie running that now would return values for 2016).

Long story short, that's pretty much how I would do that.

edit: I am assuming this is transact.

anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum

First of May posted:

A request to update an old report came in...

Evidently, my predecessor wrote this bit of SQL for a previous-year-to-date clause.
code:
PostDate BETWEEN DATEADD(yy,-1, DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), 0)) AND DATEADD(yy, -1, GETDATE())
Now, SQL isn't exactly my first language, but there's got to be a better way to do that, right?
Which SQL?

Kurieg
Jul 19, 2012

RIP Lutri: 5/19/20-4/2/20
:blizz::gamefreak:
I don't have a transact environment handy to test this in but wouldn't this work, and be less function calls?

code:
PostDate BETWEEN DATEFROMPARTS(DATEPART(yy,GETDATE())-1,1,1) AND DATEADD(yy, -1, GETDATE())

SeaborneClink
Aug 27, 2010

MAWP... MAWP!

NO SQL

Collateral Damage
Jun 13, 2009

Kurieg posted:

I don't have a transact environment handy to test this in but wouldn't this work, and be less function calls?

code:
PostDate BETWEEN DATEFROMPARTS(DATEPART(yy,GETDATE())-1,1,1) AND DATEADD(yy, -1, GETDATE())
Yeah that works in TSQL at least.

That said apart from looking janky there's nothing wrong with the original code. I've definitely seen worse ways of getting a specific date. (getting the previous year with YEAR(), casting to varchar, concatenating -01-01, casting to datetime.. :suicide:)

Collateral Damage fucked around with this message at 22:47 on Nov 1, 2017

ConfusedUs
Feb 24, 2004

Bees?
You want fucking bees?
Here you go!
ROLL INITIATIVE!!






http://howfuckedismydatabase.com/nosql/

ChubbyThePhat
Dec 22, 2006

Who nico nico needs anyone else

Collateral Damage posted:

I've definitely seen worse ways of getting a specific date. (getting the previous year with YEAR(), casting to varchar, concatenating -01-01, casting to datetime.. :suicide:)

What the.....

Collateral Damage
Jun 13, 2009

ChubbyThePhat posted:

What the.....
Let's just say when I saw the code I got a sudden keyboard imprint on my forehead.

Kurieg
Jul 19, 2012

RIP Lutri: 5/19/20-4/2/20
:blizz::gamefreak:

ChubbyThePhat posted:

What the.....

I can't remember what language it was, but the easiest way to subtract a year was to convert the date into epoch time and subtract a year's worth of milliseconds before converting it back into a date.

MF_James
May 8, 2008
I CANNOT HANDLE BEING CALLED OUT ON MY DUMBASS OPINIONS ABOUT ANTI-VIRUS AND SECURITY. I REALLY LIKE TO THINK THAT I KNOW THINGS HERE

INSTEAD I AM GOING TO WHINE ABOUT IT IN OTHER THREADS SO MY OPINION CAN FEEL VALIDATED IN AN ECHO CHAMBER I LIKE

Kurieg posted:

I can't remember what language it was, but the easiest way to subtract a year was to convert the date into epoch time and subtract a year's worth of milliseconds before converting it back into a date.

This sounds delicious and like my kind of jam.

Dick Trauma
Nov 30, 2007

God damn it, you've got to be kind.
THE NETWORK IS DOWN...


... FOR EVERYONE! :supaburn:

(Points to email that won't send due to two @ symbols in address)

ChubbyThePhat
Dec 22, 2006

Who nico nico needs anyone else

Kurieg posted:

I can't remember what language it was, but the easiest way to subtract a year was to convert the date into epoch time and subtract a year's worth of milliseconds before converting it back into a date.

Get me OUT.

Kurieg
Jul 19, 2012

RIP Lutri: 5/19/20-4/2/20
:blizz::gamefreak:

I only remember that particular quirk because during the code review my lead got confused at me just subtracting 31536000000 from a variable, so I added a definition in the header for msYear=365*24*60*60*1000; and used that instead.

Thankfully the language we use at my current job has a Date object with getYear and setYear methods.

You know, like sane people would use.

Volguus
Mar 3, 2009

Kurieg posted:

I only remember that particular quirk because during the code review my lead got confused at me just subtracting 31536000000 from a variable, so I added a definition in the header for msYear=365*24*60*60*1000; and used that instead.

Thankfully the language we use at my current job has a Date object with getYear and setYear methods.

You know, like sane people would use.

And leap years? And leap seconds? And daylight savings vs just suddenly no longer daylight savings because ... politics? Thank god for proper date libraries, that poo poo is a nightmare.

Dick Trauma posted:

THE NETWORK IS DOWN...


... FOR EVERYONE! :supaburn:

(Points to email that won't send due to two @ symbols in address)

You should file a bug to the email client provider for not properly escaping two @ symbols. Better yet, tell the user to do that.

spankmeister
Jun 15, 2008






Kurieg posted:

I only remember that particular quirk because during the code review my lead got confused at me just subtracting 31536000000 from a variable, so I added a definition in the header for msYear=365*24*60*60*1000; and used that instead.

Thankfully the language we use at my current job has a Date object with getYear and setYear methods.

You know, like sane people would use.

Yeah nice that's absolutely the wrong way to calculate a year.

Kurieg
Jul 19, 2012

RIP Lutri: 5/19/20-4/2/20
:blizz::gamefreak:

spankmeister posted:

Yeah nice that's absolutely the wrong way to calculate a year.

You work with the tools the language gives you and I had no desire to fall into the leap-year despair hole.

This was also several years ago and I wouldn't do it that way now.

Dr. Arbitrary
Mar 15, 2006

Bleak Gremlin
I've been having fun using the kind of language that first tier customer service reps use, for work that is quite a bit above that level.

"That's no problem, I'd be happy to migrate those servers into our infrastructure. My goal is to ensure that you have an outstanding server infrastructure experience!"

RFC2324
Jun 7, 2012

http 418

Dr. Arbitrary posted:

I've been having fun using the kind of language that first tier customer service reps use, for work that is quite a bit above that level.

"That's no problem, I'd be happy to migrate those servers into our infrastructure. My goal is to ensure that you have an outstanding server infrastructure experience!"

after years in call centers i can't not use the most neutral language possible when i am talking business

ChubbyThePhat
Dec 22, 2006

Who nico nico needs anyone else
I just restarted a host for some updates to firmware and none of my VMs came back up. Holy poo poo.

Managed to spend the last 45mins figuring out a way to remote into the site and figure out what happened. Finally get in and try to boot up the VMs but none of them will leave the suspended state. Queue another 10mins of me scratching my head over that before I remember I still have to exit maintenance mode on the loving host. Hop on ESXi and exit it, then poo poo comes up fine.

My brain has been completely owned today. Nothing like staying a couple hours late to fix things working exactly as intended.

SeaborneClink
Aug 27, 2010

MAWP... MAWP!

RFC2324 posted:

after years in call centers i can't not use the most neutral language possible when i am talking business

Same :respek: same

RFC2324
Jun 7, 2012

http 418


"I do apologize that you have encountered this issue, and assure you that we are doing everything possible to resolve it for you." :smithicide:

It works tho, I never encounter the screaming bosses I hear so many other people bitch about. :unsmith:

Adbot
ADBOT LOVES YOU

Kurieg
Jul 19, 2012

RIP Lutri: 5/19/20-4/2/20
:blizz::gamefreak:
printers Scanners

  • Locked thread