Oracle Server Date/Time
I want to use the oracle server machine date and time while user save any transactions from the client machine instead of the client machine date and time.
How i can solve this problem?
Thanks in advance
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Oracle Date Time
Hello all,
I am trying to insert user input (Date/Time) into a date/time field in an oracle table. I tried many ways to format the inserted value but i keep getting an oracle error. Would any one help me with the how to formate date/time to insert into date/time field in oracle through an insert sql statement. The user could pick the date and time they want to insert into this field.
Thank you so much in advance!
SQL Server Equivalent For Oracle's Julian Date
Hi every body,
I'm in process of converting an Oracle Database to SQL Server. My problem is how to represent the ORacle's Julian dates in Sql Server.
As we all know A Julian date is the number of days since Jan 1, 4712 BC. Julian dates allow continuous dating from a common reference. You can use the date format model "J" with date functions TO_DATE and TO_CHAR to convert between Oracle7 DATE values and their Julian equivalents.
for example:
SELECT TO_DATE(TRUNC(10),'J') FROM DUAL;
will return 10/01/4712
SELECT TO_CHAR(TO_DATE(TRUNC(1130),'J'),'JSP') FROM DUAL;
will return the value of 1130 in words - "One Thousand One Hundred Thirty"
This actually is my use. I just wanted to convert numbers in digits to words. in Oracle using the second example given above, it is posible to do the conversion.
But how we will do the same in SQL Server 2000. Can any body suggest an Equivalent conversion method in SQL Server 2000 or an alternative method to convert numbers in digits to words.
Please Help me out ...
Regards
Issac
Addition To Date/time Field In Oracle
Hi Guyz,
Q1
Lets say i have the following data in the date time field..
6/25/2004 7:02:31 AM
How do i add another 8000seconds to this data in oracle?
Q2
And how do i search, for an example, give me all the list of data with 6/25/2005, no matter what time it is.
I tried using the like operator but it doesnt seem to work..
Any ideas?
thankx in advance
Server Date/time Instead Of Windows Date/time
Dear VB Experts,
We are developing a Client/Server application whereby the VB executables will reside at the PC.
Server run on HP-UX 10.20. Database is Informix-Online.
One of our task is to utilise the server date and time for timestamp instead of using the Windows date and time.
How do we do that ?
Thanks in advance.
RWS
Server Date And Time
Hi all.
how can i get the server date and time. The server means the system where my access database kept and from there more than one user accessing the database. The whole user has to get the server machine's date and time. how can i get it?
saj
Get Time And Date From Server
There's something I can't do.
I wanna get the Time and Date from my Server (Windows 2000 Server), to change these values on others PC (where I use a programm of mine).
I wanna know if only using API's I can get these values from my Server or I have to generate a "Server Program" using socks (running in my Server) that give me this values when I connect to this "Server Programm".
Get Server's Date & Time?
how can i retrieve the date and time value of a SQL server? by using ado
Quote:
ado.Open "select getdate() as ServerTime"
Server's Date/Time
I am running my program in a workstation running Windows 98 as its OS. The server uses Windows NT 4. How can I extract the System's Date and Time from the server? Please help..Urgent
Get Time And Date From Server
i am trying to use API to get the time and date from server but i am getting "Can't find DLL entry Point NetRemoteTODD IN netapi32.dll" any suggestion why am i getting this error message
Here is the code I copied and paste this code from One of the thread from this web site
Private Declare Function NetRemoteTOD Lib "NETAPI32.DLL" _
(ByVal server As String, buffer As Any) As Long
Private Declare Function NetApiBufferFree Lib "NETAPI32.DLL" _
(ByVal buffer As Long) As Long
Private Declare Sub CopyMemory Lib "KERNEL32" Alias "RtlMoveMemory" _
(hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)
Private Type TIME_OF_DAY
t_elapsedt As Long
t_msecs As Long
t_hours As Long
t_mins As Long
t_secs As Long
t_hunds As Long
t_timezone As Long
t_tinterval As Long
t_day As Long
t_month As Long
t_year As Long
t_weekday As Long
End Type
Private Sub time_syn()
Dim t As TIME_OF_DAY
Dim tPtr As Long
Dim res As Long
Dim szServer As String
Dim days As Date
Dim todays As Date
'
' Replace \ntsig with your NT server that you want to get the time from
'
szServer = StrConv("\Trans_Hou", vbUnicode) 'Convert the server name to unicode
res = NetRemoteTOD(szServer, tPtr) 'You could also pass vbNullString for the server name
If res = 0 Then
CopyMemory t, ByVal tPtr, Len(t) 'Copy the pointer returned to a TIME_OF_DAY structure
days = DateSerial(70, 1, 1) + (t.t_elapsedt / 60 / 60 / 24) 'Convert the elapsed time since 1/1/70 to a date
days = days - (t.t_timezone / 60 / 24) 'Adjust for TimeZone differences
'Get local computer information for comparison
todays = DateSerial(70, 1, 1) + (DateDiff("s", DateSerial(70, 1, 1), Now()) / 60 / 60 / 24)
Me.Cls
Print DateDiff("s", DateSerial(70, 1, 1), Now()), todays, t.t_elapsedt, days
NetApiBufferFree (tPtr) 'Free the memory at the pointer
Else
MsgBox "Error occurred Call NetRemoteTOD: " & res, vbOKOnly, "NetRemoteTOD"
'Error 53: cannot find server
End If
End Sub
Server´s Date-time
Hi everybody !!
How can I get the server´s date-time?
One way is with a store procedure, but maybe from vb...
Server Date Time
Hi All,
It is required for my current project, that i want to fetch date and time from server. Im using VB6 and SQL 2000 server.
In some forms, i want to fetch the system date and time from the server which has different IP.
Can any one help me out with code?
Thanks in advance!!!
regards,
Koushik C.
Date / Time In Sql Server
How would I display only the time part of the datetime data type in SQL Server? I would like to display only the time in a text box.
Thanks in advance.
Shannan
Get Server DATE TIME.
hi,
I need to get the date and time of a private server in the local network..
how do i do this?
thanks,
Date And Time In SQL Server
Hi.
I have a table (SQLServer )Exam with 2 columns Date (DateTime) and Time (Datetime). In Date I store a date without time (format dd.mm.yyyy - 15.01.2004) and Time a time without a date (format HH:MM:SS - 12:33:00).
How to compare the current date and time (getdate()) whith theese two columns, so that only the date part of getdate() is compared with Date and only the time part of getdate() is compared with time.
Actually if I select rows from table the result for Date column is 2004-01-15 00:00:00.000
and for Date is 1899-12-30 12:33:00.000 (because of datetime type).
My select is something like this:
select .. from.. where
((getdate() 'date part'< exam.Date) OR
(getdate() 'date part' = exam.Date AND getdate() 'time part'<= exam.Time))
..
or maybe
getdate()<=exam.Date 'date part' + exam.Time 'time part'
Thanks for any suggestion.
Sebastian
SQL Server Date & Time
Hi all,
I am using SQL Server 2000. & VB6.0
I am having SQL Server in a Server machine and my application in another machine...
Here i want to trace that server machine's current data & time through vb...
How can i do that????
Pls Help me
Edited by - sangeethra on 11/14/2003 2:14:45 AM
Date And Time In The Server
Hi Gurus,
I have a appilication which is running in the server and user are login in to the machine and running it at their PC's
I need to display the Date and Time of the server.
ie. If user change his PC's date or Time That should not affect the Date and time which is display in the application.
How can I do This,
Thankx in Advance
Server Date And Time
Hi! I just wanted to ask if there is a way to access the server date and time when you are in a client computer. Are there any existing function that I could use in order to do this? Thanks. Hope you can help me.
How To Capture Server Date/time
Hi.. Everybody..
Normally we capture date/time just like this:
dim dteDate as date
dtedate = date
How to capture date/time SERVER COMPUTER to be displayed at client computer. Thanks alot for any response...
New Bie
Retrieving Date And Time Off An NT Server.
At present we have applications in VB that use time stamps taken from the client PC. Problems arise when the users tamper with their time/date setting.
So, Can anyone please tell me how to retrieve the date and time from an NT server to overcome this problem?
Date/time Fields In SQL Server
Hi,
If I have a date & time field in SQL Server - what is the best way of truncating the field so that I am left with the date element?
In Oracle I used to use the 'Trunc' function. Is there a SQL Server equivalent?
Thanks.
Retrieving Server Date/Time
My Program links up to an online mysql server, checks for new records and downloads any new ones that have been added since last check, storing them in an access database. I thought I had it all worked out but the problem I've hit is that if my time says 10:23 and I upload some new records, and your time says 10:24, then your copy of the program won't recognise them as new, as it thinks they are 1 minute old already. I discovered, that by using the INSERT INTO statment and NOW() I can store the date entered according to the servers date, so when I upload a record it's not my date being used but the servers.
My Question is this: How can I retrieve the servers date to compare record dates to see which ones are new? I know I can use SELECT * FROM mytable WHERE ... using the dates, but it would be difficult to implement like this with they way I'm comparing. I might still do it that way though.
Any suggestions? Maybe there's an easier way of determining which records have been added since last check?
Edit:
Sorry, just to specify, what I do is upload any new records, then save the date and time to the registry so that the program checks next time for any records modified/added since the last check. This time/date stored in registry needs to be from the server and not the users computer.
thanks
Hyarion
Get Date/Time From Central Server?
Is it possible to obtain the ‘Now’ Date and time constant from a central server.
i.e. you have 5 computers Networked to a central server is it possible to read the date and time from the central server rather than from your own PC.
I need this for a multi user app that I am writing where date and time events are logged into a central database. If computers within the network are set to the incorrect date or time then the information stored will be inaccurate.
Remote Server Date And Time
Hello Friends...
i m Working on a Cleint Server Environemnt Working in a LAN. Now i need to get the Server Date and time so that i can use it for Cleint PC.......
Remote Server Date ?
Remote server Time ?
VB and SQL Server .
{ RESOLVED } Get The Date Time Value From SQL Server..!
I have a field in SQL Server which stores Date and Time information.
it is populated by,
Code:
INSERT INTO tblName (fieldDateTime) VALUES (CURRENT_TIMESTAMP)
Now I need to retrieve this value in VB as it is. My problem is I always loose the last part of the value.
For example in SQL Server I can see the value as
2004-06-08 21:19:49.817
VB looses the last 817 part..!
I am stuck here.
Cheers.
Time And Date From Server Computer
Hi
I have one program which i devloped in VB 6 and it is running ofnetwork.
Problem is this that time and date is not same at all computer so itcreate confustion
i want that all work station or computer should take Date and Time fromServer computer the computer where i selcted the ODBC.
Pls tell me what code i shoud add.
Regards
Find Server Date And Time
Hi:
7/1/2003
Can some help us in some code that will find the date and time on the
server of a LAN. We need to capture that time and date and compare it to
the date and time in a field in the database.
Thank you
How Can I Get Date And Time Of The Computer Server?
Hi guys can someone help me how can I get the date of the computer server in the the client computer? I tried the getdate() function but it does not work. I'm only using MS Access as my database. Does getdate() function is connected to what database I'm using? And can someone help me how can I get the date on the server in the client computer. Thanks in advance.
How To Insert Date And Time In SQL Server
Dear All,
Please guide me how to insert current date in one field and current time in another field in SQL server. I used CAST, it works with date (It works but I am not clear) but not work at all with time.
I selcted smalldatetime for date and timestamp for current time storage.
regards,
Santulan
Inserting Date And Time Info Into SQL Server
Hello,
I am having problems trying to insert the date and time values into a SQL server database. The user will enter in the date and time from a datepicker control and I have the format for the dates set as "custom" and then the format is "MM/dd/yyy hh:mm:ss tt".
I have a table called Wateroff and in there i have created a column that is defined as "smalldatetime". I want the ability to add the date and time information into this column. I have tried FormatDateTime(), Format() with no luck. I am listing my code below.
Code:
Set MainBreakRs = MainBreakConn.Execute("Insert into WaterOff (Comments, " & _
"DateReceived, FromStreet, StreetName, " & _
"ToStreet, CrewNo, DateOff, DateOn, Editedby, ModifiedDate,
EstDate.value) values ('" & _
txtComments.Text + "', " + Format(dtDate.Value, "MM/dd/yyy hh:mm:ss tt") & _
", '" + txtStreetFrom.Text + "', '" + txtStreetName.Text & _
"', '" & _
txtStreetTo.Text + "', '" + txtCrewNo.Text + "', " & _
Format(dtDateOff.Value, "MM/dd/yyy hh:mm:ss tt") + ", " & _
Format(dtDateOn.Value, "MM/dd/yyy hh:mm:ss tt") + ", '" + lblEditedByForInput.Caption & _
"', " + Format(Now, "MM/dd/yyy hh:mm:ss tt") & _
", " + Format(dtEstDate.Value, "MM/dd/yyy hh:mm:ss tt") + ")")
Thanks and any help is appreciated.
Raj
Edit: Moved from General
SQL Server/Access Date/Time Quirks
I have seen some responses to similar problems as my own, but they were all years old so im
hoping there is some more uptodate advice available.
The problem is dates and their conversions between my VB6 program and MS Access/SQL Server 2000.
I get the old system getting confused between Day/Month even though I use text month as far as possible.
I try to use the following code
StartDate = monthToText(mvStartDate.Month) & "/" & mvStartDate.Day & "/" & mvStartDate.Year & " " & dtStartTime.Hour
& ":" & dtStartTime.Minute & ":" & dtStartTime.Second
Using a month control, and a small function to turn month numbers in month 3 digit texts, Jan, Feb etc.
Then I use Datevalue before I send the dates, such as...
If modDatabase.DBType = e_databaseTypes_AccessFile Then
.Open "SELECT * FROM datastore WHERE datatimestamp>#" & DateValue(theStartDate) & "# AND datatimestamp<#" &
DateValue(theEndDate) _
& "# AND tagtableid=" & theTagID & " ORDER BY datatimestamp", modDatabase.ADOConnection, adOpenStatic,
adLockReadOnly
ElseIf modDatabase.DBType = e_databaseTypes_SQLserver Then
.Open "SELECT * FROM datastore WHERE datatimestamp>'" & DateValue(theStartDate) & "' AND datatimestamp<'" &
DateValue(theEndDate) & "'" _
& " AND tagtableid=" & theTagID & " ORDER BY datatimestamp", modDatabase.ADOConnection, adOpenStatic,
adLockReadOnly
End If
However, I get VERY strange results, eg, when picking to select data between 1st April 1999 and 30th April 1999, the data
returned is between Jan 4th 1999 and April 30th 1999, THEN if I try selecting data between dates such as 9th April-13thApril
I get Zero results returned (there is data between these dates), and other strange dates behaviour.
Any help in making sure I get the right results?? When I insert data into the database, I use the same Datevalue method and
ensure months are in text form.
How To Get The Mysql Server's Current Time And Date
Hi,
I've problem on getting the server's current time and date. although before this i've ask about how to auto save server's current time and date when we save a record, but then, i don't know how to get it. The situation is, my system will compare server's current time and date with in the record.
can anybody help me.....
Finding Date/Time Of File On FTP Server
FTp Server Get a File Date/Time Before Download
I am polling a particular file on an ftp server.
I have a problem. using wininet.,, the controls do not give me the (seconds) when i retreive the date/time of the file on the Server.
FileDateTime when looking at the local drives gives me hh:mm:ss ok. BUT under ftp,using wininet, only hh:mm
I need to look at the time,hh:mm:ss,,, to establish if it is worth getting the file from the server. ie. it has changed.
Is there any control which will let me LOOK at a file on an ftp server, and get data,hours,minutes,seconds., that works.
Or, some other way of establishing the state of the file has altered,.. (it will always be the same size!)
Appreciate any advice.
Check For File Size/date/time On A Ftp Server
Hello all I am looking for a example of a program that can ftp into my defined directory on the server and get the file size/date/time of the file and compare it with the file that the user is using.
If the file on the server is newer, it downloads it and lets the user use it. If the file is not newer, it sends the users file to the server.
Anything like this exist? I am already using the API FtpGetFile and FtpPutFile to retrieve and get a file from the server. Any way I can use that to see the size/date and time?
Thanks for your time,
David
Get File Infor (Ex:Time/Date Stamp) From FTP Server
I need to retrieve the Time / Date stamp (and filename for it) from an ftp server so I can then downlaod the file.
the file name changes daily and follows no 'standard' so Thats why I need the time/date
I cant use VB6 controls (like INET etc) because this is Access97 VBA...so it has to be API's
any help is GREATLY appreciated!
Thanks
Excel Won't Accept Date Time Field From SQL Server
Hi
I'm workin on a project at the moment that requires that I can write the contents of a datagrid to an excell work book, I have most of the code sorted however excel does not show the date time fields pulled from the SQL server. Here is my code
Private Sub btn_dumptoexcel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_dumptoexcel.Click
Try
'Variables
Dim ExcelApp As New Excel.Application
Dim Wkbook As Excel.Workbook
Dim Wksheet As Excel.Worksheet
'Make the Excel Application visible
ExcelApp.Visible = True
'Get a new workbook and select the first sheet
Wkbook = ExcelApp.Workbooks.Add
Wksheet = ExcelApp.ActiveSheet
Dim dt As DataTable = ds.Tables(dsTableName) 'Dataset name used to populate the datagrid
Dim col As DataColumn
Dim n As Integer
'Add field names to each cell
For n = 0 To dt.Columns.Count - 1
Wksheet.Cells(1, n + 1).value = dt.Columns(n).ColumnName
Next
'Loop through the rows in the table and put the data into their cells
Dim row As DataRelation
For n = 0 To dt.Rows.Count - 1
Wksheet.Range("A" & n + 2, "G" & n + 2).Value = dt.Rows(n).ItemArray
Next
'Format field names as bold and center
With Wksheet.Range("A1", "L1")
.Font.Bold = True
.VerticalAlignment = Excel.XlVAlign.xlVAlignCenter
.Font.Size = 12
End With
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Anyone got any ideas or see where I'm going wrong?
Thanx
Phil
Re-Posted : How To Check The Date/Time Stamp Of A File On A Web Server
Hi All,
I'm still trying to sort this, can anybody please help, , I think I have got a little further, should I be using the Internet Transfer Control shipped with VB6 ?
This is a control I have not used before so really need some help. All I want to do is either read the date/time stamp of a compiled VB Exe on a webserver, if it is later than the one on the local machine, Copy it from the server into the same location overwriting the one on the local machine. If the Date/Time stamp cannot be read, can the version number perhaps ?
Please, Please Help, my deadline for this is Wednesday 16th June, Tomorrow ! , and I have tried myself now for 2 weeks and failed miserably....
REQ Help: Calculating Elapsed Time From Date/time Began From Date/time Ended
I have four controls, two are Date-Time Pickers set for Date and the last two are text boxes set for Time with the "...If Not IsTime()..." validation.
It is the standard Date and Time problem began, Date and Time problem ended.
I am trying to calculate the elapsed time between these in "" DAYS "" HOURS ""MINUTES.
I coded this in Lotus Notes yet exporting my knowledge to VB is problematic.
Has anyone a code snippet of how to do this in VB - yes, I know about the DateDiff.
Many, MANY thanks!
Date Conversion As Oracle Database Date Default Format
Select sysdate from dual ; //oracle database
The result is : 28-AUG-04
How to convert “date” in vb to the above format?
Using below statement :
FormatDateTime(Date, vbLongDate) // Saturday, August 28, 2004
Then, combine with string functions (such as instr, left, mid, etc) can be achieved the desired result.
Any shortcut than above mentioned?
Thanks.
vb999
|