Questions tagged [getdate]

getdate is a T-SQL function available to retrieve the current system date and time.

getdate() is a function that returns the current system date and time in a datetime format in RDBMSs that use T-SQL. It is available for use in MS SQL Server, SAP/Sybase Adaptive Server Anywhere, SAP/Sybase SQL Anywhere and SAP/Sybase IQ.

412 questions
-1
votes
2 answers

PowerShell - Special Date Format

I'd like to have an output of get-date for the current day in PowerShell to the following format: 11-Apr-2018 I've tried playing around with this and have not been successful. Ideas?
shoppers1d3e
  • 101
  • 2
  • 4
-1
votes
1 answer

I want to know how to change the date

For example, the date in the DB .. 2017-11-22 05:00:00 2017-11-22 05:30:00 2017-11-23 05:45:00 2017-11-23 05:50:00 2017-11-24 06:00:00 2017-11-24 06:30:00 2017-11-24 06:05:00 Day 22 is +1 day from current date Day 23 is +2 days from the current…
ted
  • 21
  • 5
-1
votes
3 answers

SQL Server: Return all rows of a table which date field satisfies some date conditions

I have a table with a lot of employees, let's say 'Employees' table. This table have a date column among others. Let's say this column is called, 'InjuryDate'. I would like to select all the employees that satisfy below conditions: InjuryDate is…
Astro
  • 367
  • 1
  • 3
  • 17
-1
votes
2 answers

latest full half hour as per the clock time data in SQL

I trying to fetch data for the latest full half hour as per the clock time. for example if getdate() return me '2016-11-14 10:14:25.567' , i want data from '2016-11-14 09:30:00.000' to '2016-11-14 10:00:00.000'
user6363065
  • 81
  • 2
  • 10
-1
votes
3 answers

Best way to convert/show a date

I have a php form which requires the user to input a date. I have three check boxes that they can choose from: "today", "tomorrow", and "other" (where other requires them to enter a specific date in the field. I want "today" to print out the…
djd97
  • 77
  • 1
  • 1
  • 10
-1
votes
6 answers

setting GETDATE() to only give out day on default value in MSSQL

I'm trying to set a column with a default value or binding of the current date in MSSQL. I'm currently using GETDATE(), but this gives me the timestamp with the hours, minutes, seconds and milliseconds, I only need the day part (2015-03-05). Only…
Nir Tzezana
  • 2,275
  • 3
  • 33
  • 56
-1
votes
3 answers

Display a string if getdate() has passed a certain time

So this is what I have: declare @breakend datetime, @breakstart datetime set @breakend = (select Convert(varchar(20),DateAdd(month, 0, convert(varchar(20),getdate(), 102) + Space(1) + '9:00:00 AM'), 120)) set @breakstart = GETDATE() select…
jjohnson
  • 203
  • 1
  • 5
  • 16
-1
votes
1 answer

Function Year and MONTH for GetDate();

please can you help me with my problem? So i have problem that i must search some data for some time but evertime return me diferent value. // This return me 10k values YEAR(pol.datum) >= YEAR(GETDATE()) - 1 and YEAR(pol.datum) <=…
user2813962
  • 3
  • 1
  • 1
  • 4
-1
votes
2 answers

GETDATE() doesn't return the milliseconds and minutes

declare @Date date SET @Date =GETDATE() print @date Declaration gives me the result : 2013-08-04 But I need also milliseconds and minutes. How I can achieve this?
sakir
  • 3,391
  • 8
  • 34
  • 50
-1
votes
1 answer

How do I implement $_GET along with getdate() php

I want to use the $_GET[] along with the getdate() to pull in the date as query string in the form of: YYYY-mm-dd. If no date is entered, then get the current date. This is what I have done, but I don't have a clue as to if I'm close or…
-1
votes
4 answers

Get Date of every alternate Friday

I am wondering if i can get the date of every alternate friday starting with 13th of April, 2012 to give it as a parameter to a stored procedure using c#, asp.net? It should also be most recently passed date. Thank you!
challengeAccepted
  • 7,106
  • 20
  • 74
  • 105
-2
votes
2 answers

Convert WHERE clause to CASE expression

Can someone please help me rewrite this using a CASE (using easy to read syntax): SELECT * FROM TBL_A WHERE COLUMN_A BETWEEN DATEADD(MONTH, DATEDIFF(MONTH, +1, GETDATE()), 0) AND DATEADD(MONTH, DATEDIFF(MONTH, -1, GETDATE()),…
Ishy
  • 9
  • 4
-2
votes
2 answers

SQL GetDate() displays current date or system date?

I need to know whether SQL GETDATE() displays actual current date or system date ?
Abdul
  • 2,002
  • 7
  • 31
  • 65
-2
votes
2 answers

Insert Date and Time only if > = Current Date

I have a field appointment_date and appointment_time and datatype is date and time respectively. The table name is appointment. What our teacher wanted was to be able to add appointment ONLY if it is greater than or equal to the current_date or…
-2
votes
1 answer

Day of the week - Javascript

Something is really off about my script.. //Day of the Week checkDate = "03/18/15"; year = checkDate.substr(6,2); month = checkDate.substr(0,2); day = checkDate.substr(3,2); var d = new Date("20"+year, month, day); var…
user4713659
  • 25
  • 1
  • 6
1 2 3
27
28