Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Sign up

Sign up | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Query WO's with Target Start in Current Month
January 8, 2019
11:09 pm
Avatar
acolson13
New Member
Members
Forum Posts: 1
Member Since:
April 13, 2017
sp_UserOfflineSmall Offline

Looking for some help on creating a querry saved that will return all records with a Target Start Date that are within the current calendar month.  Example:  WO has Targstartdate of 2-2-19, would not show up in result set as a WO for the month until February.  Tried using between functions with getdates but there is to much variability in the Targ Starts accross the records.

 

thanks,

January 10, 2019
1:49 am
Avatar
Miki Babic
Member
Members
Forum Posts: 4
Member Since:
May 22, 2018
sp_UserOfflineSmall Offline

SELECT
*
FROM
workorder
WHERE
workorder.targstartdate BETWEEN DATEADD(mm, DATEDIFF(mm, 0, GETDATE()), 0) AND DATEADD (dd, -1, DATEADD(mm, DATEDIFF(mm, 0, GETDATE()) + 1, 0))

Forum Timezone: America/New_York

Most Users Ever Online: 54

Currently Online:
1 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

sun kim: 59

madd0g17: 59

v.barsamov: 51

Maximofresher: 44

cgregory: 42

matta0990: 33

Member Stats:

Guest Posters: 0

Members: 13459

Moderators: 0

Admins: 3

Forum Stats:

Groups: 1

Forums: 8

Topics: 1515

Posts: 4179

Newest Members:

Danielle Newhouse, Marc Pelletier, Mohamed MTIBAA, rohitlode, kyliematt, Alex Tupinamba

Administrators: Chon: 1090, kristensibilia: 0, Joe Grassia: 0