Questions tagged [sqldatetime]

The SQLDateTime tag is for questions related to how database SQL queries handle date and time information.

Databases can store date and time information in various ways. The is used for questions related to defining and accessing date/time data. Some considerations for this type of data are

  • Precision
  • Calculations
  • Business rules
  • Scheduling

Most database software allows date types that include both the date and time of day. There are various types of date types that can include timezone information, and interval information.

See the for questions relating to functions used for determining things such as last_day(date) which returns the last day of the month for the specified date, and functions for returning the current date or timestamp.

177 questions
0
votes
1 answer

How to convert OLE Automation Date to My sql date

How to convert OLE Automation Date to a Mysql standard date type?
anuradha
  • 123
  • 1
  • 9
0
votes
1 answer

How to add column in table having default datetime value of timestamp

I want to add a column in my table police_publiclocation where column must have 5hr and 30min greater value than current TIMESTAMP value. I am doing the following but it is not working.. Please provide me some solution.. Thanks in advance.. ALTER…
Abhishek Sahay
  • 141
  • 1
  • 9
0
votes
1 answer

date convert from yyyy-mm-dd to yyy-mm-dd converting year to day

I have migrated data from old DB to new DB where date was taken as varchar, I have migrated data successfully but problem in date . In old DB the format of date is 25-01-02 where 25 is day 01 is month and 02 is year. But my script converted it to…
mks
  • 37
  • 1
  • 10
0
votes
1 answer

Need assistance in calculating Due Date using SQL Server Functions

Am trying to calculate due date using invoice date by the following constraints will have two text boxes one is to enter day of the month and another is to enter the day before due month if the day of the month is 4 and day before due month is 5 we…
balajivaishnav
  • 2,795
  • 4
  • 23
  • 38
0
votes
1 answer

SQL query min(date) from one column and max(amount) from another

I have a table and it looks like Table I have I need to create a table that consists of the following columns Table I need Table includes unique ID, min date when the number of sms was max and max date when the number of sms was min, including the…
0
votes
0 answers

How to convert sql.date to util.date so that i can set that date to JDateChooser?

I'm trying to convert sql.date which i'm getting from my sqlite database to util.date. And i want to set that date to JDateChooser. I've literally tried all possible ways but it seems i'm missing something. Can anybody tell me what's wrong? try{ …
Parag Pawar
  • 827
  • 3
  • 12
  • 23
0
votes
1 answer

Select query produces SqlDateTime overflow on valid dates

I have a problem: on a simple select like SELECT * FROM table SqlDateTime overflow error is randomly returned (few times it works OK after that error is returned; after that it again works few times and after that error is returned again) - error…
0
votes
2 answers

Store date range in a single column in Oracle SQL

Here trip 1 involves 2 activity_code in a single day and also concludes in a single day and most other activities are just single day but i have one trip that span over more than one day. What could be the best possible way to store date range for…
mhrzn
  • 379
  • 1
  • 4
  • 18
0
votes
2 answers

How to convert India Standard Time to SQL date and time in C#

I want to convert below date and time format to SQL date and time Thu Apr 07 2016 06:30:00 GMT+0530 (India Standard Time) any one have idea Thanks.
Chenna Rao
  • 111
  • 3
  • 11
0
votes
2 answers

SqlDateTime overflow when using .ExecuteReader

I am getting this error when executing a reader which is used on an asp page: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. A date is selected from a calendar, and is set to a DateTime variable, which is…
pfinferno
  • 1,779
  • 3
  • 34
  • 62
0
votes
2 answers

sql: rr date format

My question has to do with the 5th command. create ex_table(on_date date); insert into ex_table values(to_date('23-aug-75','dd-mm-rr')); insert into ex_table values(to_date('23-aug-75','dd-mm-yy')); After the applying the above 3 commands…
user5093601
0
votes
1 answer

Replacing 01/01/1900 from SQL resultset and exporting to Excel using C#

foreach (var item in bh) { worksheet.Cells[rowNumber, 1].Value = item.bill_number; worksheet.Cells[rowNumber, 2].Value = item.yearref + @"\" + item.monthref; worksheet.Cells[rowNumber,…
Hamza Zahir
  • 69
  • 1
  • 7
0
votes
1 answer

Dates for different calendars

I am working on a project which is running in 2 countries already. Everything was fine until we deployed the project in Nepal. The problem is they are not working with standard Gregorian calendar. They have their own calendar called Bikram Sanwant…
hiren soni
  • 174
  • 2
  • 2
  • 17
0
votes
2 answers

Java date to sql date

How can I store a specific date from java to my database? (Not only the date today, but also some dates that the user wants to specifiy) try { SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy"); Date date =…
meatno
  • 19
  • 2
  • 6
0
votes
0 answers

ClassCastException: Cannot cast java.sql.Date (id=9010) to java.sql.Timestamp

I am having a problem with a Java 1.4 app. I am executing a JDBC Qyery-which is 2 date fields in an Oracle database (both the 2 fields I am reading is of type DATE with NULLABLE = false) SELECT effFrom, effTo FROM myTable WHERE .... And is exceuted…
cp5
  • 1,087
  • 6
  • 26
  • 58