Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Vb-sql Server Date Field Problem:URGENT


in my vb application i am using DTPicker in forms.when i am trying to insert datefield as dd/mm/yy format in my table(sql server) through my vb application error is occured . the error iserror -2147217913 conversion of a char data type to a datetime datatype resulted in an out of datetime valuewhen i try to insert datefield on dd/mm/yyyy through query analyser there is no problemhelp me and send some soucecode to solve this problem in my vb application its very urgent




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
URGENT:server Date
"NetRemoteTOD" function returns date of server specified.
but it does not gives date of novell server.
is anybody know about it ?

Defaulting A DateTime Field To Date Only In SQL Server Db
I have a datetime field "RecordDate" that I want to have default to the current date.  If I specify getdate() as the default value I end up with the date and time both.  In Access I was able to specify the field format as mm/dd/yyyy and the default value as Date().  Is there anything similar I can do in my SQL database to force the data to format the way I want it?

Store Date And Time In SQL Server Datetime Field
I wanted to store date and time (both in single field)
I tried following in order to store the date entered in text box in format dd/mm/yyyy

Please help

Thanks in advance
VIkAS

SQL Server/Access 2007 Date Field Is Slooooow! Why?
I am working with a client to migrate an Access 2000 app to Access 2007. I went through the conversion process and everything runs great except anything having to do with date/time fields. The Access app is odbc-linked to a back-end SQL Server 2000 DB. Whenever a date field is clicked, the app appears to "hang" for about thirty seconds! This is driving me nuts! There is no event properties tied to the field. In fact, I can look at the table view and click on a date without even going through a form and it does the same thing. What the heck is it doing? How can I fix this? Any ideas?

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

Every Record Has A Date Field. I Want To Find A Date And From This Date, I Want To Read Records To E
Every record has a date field. I want to find a date and from this date, I want to read records to eof. What is the code? - Thanks

(PLz Its Urgent, And Its Too Long) Data Field <field Name> Not Found
I am generating a report using shape statements and its hirarichy is like htis
Wing
    class in that wing
        section of a class
            name of student in this section


here is the shape statement

qry = "SHAPE "
     qry = qry & "{ "
     qry = qry & "select wing_name, wing_id from wing "
     qry = qry & "where wing_id = '" & vwing & "'"
     qry = qry & "} "
     qry = qry & "AS com_student_list APPEND "
     qry = qry & "( "
     qry = qry & "( "
     qry = qry & "SHAPE "
     qry = qry & "{ "
     qry = qry & "select class.* from class "
     qry = qry & "} "
     qry = qry & "AS chcom_student_list APPEND "
     qry = qry & "( "
     qry = qry & "( "
     qry = qry & "SHAPE "
     qry = qry & "{ "
     qry = qry & "select section_id,class_id "
     qry = qry & "from class_section "
     qry = qry & "where year = '" & vyear & "' "
     qry = qry & "} "
     qry = qry & "AS ch_chcom_student_list APPEND "
     qry = qry & "( "
     qry = qry & "{ "
     qry = qry & "select a.student_id , "
     qry = qry & "r.fname//' '//r.mname//' '//r.lname as name , "
     qry = qry & "a.section_id "
     qry = qry & "from assign_section a , registration r, student s "
     qry = qry & "Where a.student_id = s.student_id "
     qry = qry & "and s.registration_id = r.registration_id "
     qry = qry & "and a.year = '" & vyear & "' "
     qry = qry & "order by student_id "
     qry = qry & "} "
     qry = qry & "AS ch_ch_chcom_student_list RELATE "
     qry = qry & "'SECTION_ID' TO 'SECTION_ID' "
     qry = qry & ") "
     qry = qry & "AS ch_ch_chcom_student_list "
     qry = qry & ") "
     qry = qry & "AS ch_chcom_student_list RELATE "
     qry = qry & "'CLASS_ID' TO 'CLASS_ID' "
     qry = qry & ") "
     qry = qry & "AS ch_chcom_student_list "
     qry = qry & ") "
     qry = qry & "AS chcom_student_list RELATE "
     qry = qry & "'WING_ID' TO 'WING_ID' "
     qry = qry & ") "
     qry = qry & "AS chcom_student_list "

format of report is like this
Wing ID    SE
Wing name
    class ID SE06
    class
        Section Id SE06BLU
            Studetn Id        Name
            100099        Sabeen Iqbal
            100099        Sabeen Iqbal
            100099        Sabeen Iqbal

first it give this error on class_id (if I delete this txt box )
then gives error for class (if I delete this txt box too )
then gives error for section_id (if I delete this txt box also)
then reports is generated, though the result is correct but I can't get info that these student is are in whcih section of which class

here are the tables
wing
wing id    pk
wing name

class
wing id    fk
class id     pk
class

class_section
class id    fk
sectionId    pk
year pk (composite pk)

assign_section
studentId     fk
section_id    fk
year     fk (composite fK)


I've checked the spelling in the data feild property thsee are correct and
data report event is initialized (i've checked it )


            



Edited by - haahoou on 2/8/2004 5:10:53 AM

Change Date Field To A Text Field Without The Slashes
I have a field called statement date which is a date type "08/21/2008".
I want to remove the "/" from that variable. Is there an easy way to do that?

Grouping By Date Where Date Field Is Date/time
I have an SQL7 database storing datetime data, and totaliser reading, new records are added every 5 minutes.

I have written the following sql to give me the the min and max totaliser reading for each day - which works fine - except that the resultant Date field is a text field not a date field so the order statement generates an incorrect listing if the data selected sarts in one month and ends in the next, eg.

select left(Date, 12) as Date, Min(Reading) as Day_Start, Max(Reading) as Day_End from Steam where tag_no = 2 and (Date <= '24-November-2005 00:00:00' and Date >= '22-October-2005 00:00:00') Group By left(Date, 12) order by Date asc

Is there another function I can use to extract just the date from the date/time field as a date data type?

I cannot alter the database as its structure is predetermined by the remote field device supplying the data.

Date Picker Control Doesn't Show Current Date In Field
How do I set the display date in the Date Picker control field ? MSDN says that it should return the current date by default, but it only shows the current date highlighted in the drop down calendar.

The control shows the date when the control was created and added to the form.

How do I set the date at form load ?


Code:
dtpicker1.value = ? ' how do I call current date ?

SQL Update Subtracting Date From Date --&gt; Result Into Field
Am having a little trouble with an Update SQL statement.
The code that I have come up with is
strSql = "Update Client_Details SET Client_Details.Days_CTS= " & Date & "- ClientDCTS.M_Date ........

It will come up with the error
Disallowed implicit conversion from data type smalldatetime to data type, table FOXGUI.dbo.Client_Details', column 'Days_CTS', Use the CONVERT function to run this query
The fields data types are as follows
M_Date smalldatetime
days_CTS Int
I can understand what they mean but I just don;t know the code that I should be using.
ANyone have any ideas?

Updating Date Field With Null Value (date Picker)
Hello,

I am using VB and access. For date I am nsing date Picker. How can I update a date with null value?

I am using the code update the date field:

DateColumn=#" & Format(DTP1, "mm/dd/yyyy") & "#

When I try to udate the field with null value I receive error: syntex error in date in query expression '##'.
Please advice me how to update with null values.

Regards,
Elahi

Only Want Date Part Of Date Time Field
How can I using an SQL statement just reitrieve the date part of a database field.

The data is stored as 10 05 2001 12:31.

At moment sql is bringing back the whole field. For grouping purposes I only want the date ie 10 05 2003.

Any ideas??

Getting Numbers In Date Field Into Date Format???
in my access db i have an old table and the dates were never formatted eg its just 791023 as in 23 of oct 1979 so i had to change that to get it in date format so i did this using a query

UPDATE history_date SET history_date.theDate = format([theDate]," mm/dd/yy");

like it worked and put in the slashes but the date is different
it came out 01/25/55 when the date was originally 641027
why is it changing it ???
like i tried diff format like yy/mm/dd and still the same...
confused!!please help if u know anything...

AutoNumber Field Vs. Date Field...?
I have a database with some data. This database has a date field. When I add an AutoNumber field my data become this:


Code:
DateField AutoNumberField
01/01/2004 1
01/01/2003 2
01/01/2002 3

But I'd like to do it, sorting by date:


Code:
DateField AutoNumberField
01/01/2004 3
01/01/2003 2
01/01/2002 1

How to do it?

Thanks.

URGENT:Connecting SQL Server Through Proxy Server
Hi all !
I want to know how can I connect a remote SQL server database, which is on the Internet, from my local computer. The local computer is on LAN and connected to Internet through wingate proxy server. How can I specify the proxy server address in my code to connect to the remote database?

Please reply soon.

Thanks in advance.

Retrieve Date From Novell Server (not System Date)
Hi,

I'm looking for a way to retrieve the date (with or without the time
portion) from our Novell server on the network (rather than the machine's
system date) and store it in a timestamp variable, all from within a VB
program. But, I don't want the system date of the individual machine running
the program to be changed in the process.

Does anyone know if this is possible or even how I would go about doing this
from within my VB program?

Thanks for your help.
Donna

Validating Server's Date Against A Date In An MS Access Database
I'm trying to redirect a user based on what date the field "expires" in my MS Access 2K DB has - This section is where I want to redirect to a page if the expires date in my database = today.

I'm selecting the table above ( rsUser.Source = "SELECT user_username, user_password, expires" ) but I don't think that the Sub is written right.

    Sub currentDate
    currentDate = Date
    If expires = Date Then
    redirectLoginSuccess = "expiretoday.asp"
    End If
    End Sub

I'm new to VB; the ASP page I'm calling this through just skips this routine - which means I didn't do it right. Any suggestions?

Parameter Field! Urgent!!!!
Hey guys? the doubt is:

I try to pass a data value by parameter field, and i use this line of command(IN VB):

RptFat.ParameterFields(0) = "DataInicio;" & Left(dtpPeriodoDe.Value, 10) & ";True"

when i run the system in visual basic, in the moment are data is putted on report, shows this error msg:
"err 20533 Invalid parameter field value"
the parameter field is configured for data values. i haved configured to string values,but, i continue without solutions to this trouble. People, help me!
Thanks a lot!

Urgent- Returing Value Of DB Field??
I write the following function to return the value of the field of database.

I'm returning the value like:
GetDataValue = ars!FieldName 'Error
But this line gives mee the error.

some 1 plz help me how can i return the value of database field??


public Function GetDataValue(byval FieldName as string, byval DistrictName as string)

Dim cnn as ADODB.Connection
Dim ars as ADODB.Recordset

set cnn = new ADODB.Connection
With cnn
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:MapData.mdb;Persist Security Info=false"
.Open
End With

SQL = "select " + FieldName + " from DistData where District = " + "'" + DistrictName + "'"
set ars = cnn.Execute(SQL)


GetDataValue = ars!FieldName 'error
ars.Close
cnn.Close

set ars = nothing
set cnn = nothing
End Function




...---.....
Hassan Zia
Hassan_Zia@mathtech-pk.com

Dbgrid With Memo Field, URGENT
I have a dbgrid field which displays a memo field from Access. It was working fine in Access97, but after the upgrade to Access 2000, I can't seem to limit the width of the display column and make the memo text wrap around. The text simply keeps going and one is required to put the cursor in the field and arrow right to see the rest of the text. Does anyone know what I need to do to fix this? Thanks in advance.

Memo Field Returning As Null? URGENT
I have a Word VBA app that requires a large text entry (large paragraph) to be stored for future use. The text stores ok, however, when I pull the data, it returns a null value and I have no data. I changed the data type in Access to Text and that fixed the problem, but the limitations of the text data type aren't acceptable in my scenario.


Code:
Set objRec = objDB.Execute("SELECT LetterData.TextEntered FROM LetterData WHERE LetterData.Case='" & strCase & "'")


If objRec.BOF = True Or objRec.EOF = True Then
MsgBox "No information found for case number " & strCase & ".", vbOKOnly
+ vbCritical, "Error"
Set objRec = Nothing
objDB.Close
ElseIf objRec.RecordCount <> 0 Then
'Use previously entered text from user, if nothing in database, do nothing
If objRec("TextEntered") <> Null Then
UserText$ = objRec("TextEntered").GetChunk(65000)
Else
UserText$ = "Null set returned."
End If
objDB.Close
ElseIf objRec.RecordCount = Null Then
MsgBox "No information found for case number " & strCase & ".", vbOKOnly
+ vbInformation, "Empty"
Set objRec = Nothing
objDB.Close
End If

Ideas anyone?

Selecting Time Field In Query - Urgent
Hi All,

pls help me with this.

I am having a query in which one field is a datetime. I am using MS Access and VB 6. The data is stored as time in hh:mm format. Usually for a date field we enclose the value within ## (like#31/07/2006#). This does not work with time field. what is the syntax for time field?

Thanks in Advance!


Binish

URGENT: Crystal Reports And BLOB Field.
Hi guys,

its little urgent!

i wish to embedd a blob field which stores a picture in my crystal report in detail-tab. somehow its not been displayed... kindly help me for this problem.

well, all i have done is ... set up the connection for the report, and put the picture field on the report in detail tab.

plz helpppppppppppppppppppppppp

butterfly.

Daring ideas are like chessmen moved forward. They may be beaten, but they may start a winning game.

Checking Between Date VB And Date SQL Server
I am trying to check a vb date against a SQL Server 2000 date but it doesn't bring me results.

My DateOfBirth value is "dd-mm-yyyy" and my SQL Server columntype is smalldatetime.

My sub is:


Code:
Public Sub checkLeerling()
On Error GoTo Errs
Dim rsLeerling As Recordset
Dim strSQL As String

strSQL = "SELECT Achternaam, Geboortedatum FROM tblLeerling WHERE LOWER(Achternaam) ='" & _
Trim$(LCase(mudtProps.Achternaam)) & "' AND CONVERT(datetime, Geboortedatum , 105)= " & mudtProps.Geboortedatum
Set rsLeerling = New Recordset

rsLeerling.Open strSQL, cnDI, adOpenStatic, adLockReadOnly

MsgBox rsLeerling("Geboortedatum")

If Not (rsLeerling.BOF And rsLeerling.EOF) Then
RaiseEvent LeerlingBestaatAl
Else
RaiseEvent LeerlingBestaatNiet
End If

rsLeerling.Close
Set rsLeerling = Nothing

Errs:
Debug.Print Err.Number
Debug.Print Err.Description


End Sub

mudtprops.Geboortedatum looks like this:


Code:
Public Property Let Geboortedatum(Value As Variant)

If Not mflgEditing Then Err.Raise 383

If Len(Trim(Value)) = 0 Then
mudtProps.Geboortedatum = ""
mobjValid.RuleBroken "Geboortedatum", True

ElseIf IsDate(Value) Then
mudtProps.Geboortedatum = CVDate(Value)
mobjValid.RuleBroken "Geboortedatum", False

checkLeerling

Else
mobjValid.RuleBroken "Geboortedatum", True

End If

mflgDirty = True

End Property

Public Property Get Geboortedatum() As Variant

Geboortedatum = mudtProps.Geboortedatum

End Property

Anybody has an idea why my check on this date doesn't work? Checking purely on the LastName of a student it works perfectly but it needs to check on the date of birth too.....

Kind regards,

Richard

Again The DATE Field !!
Good Morning Guys, again i want to disturb u all (sorry for that)

My problem is :

I have 30 date fields, if user enters date in any one or few fields, that value(s) only to be stored in tabel. All other fields to be left blank. Is it possible to do like that?

My code is......

VB Code:
Private Sub MonthView1_DateClick(ByVal DateClicked As Date)Me.Controls(strCtrl).Text = MonthView1.ValueMonthView1.Visible = FalseEnd Sub Private Sub Text1_Click()strCtrl = "Text1"MonthView1.ToolTipText = Me.Controls(strCtrl).TopMonthView1.Left = Me.Controls(strCtrl).LeftMonthView1.Visible = TrueEnd Sub Private Sub Text3_Click()strCtrl = "Text3"MonthView1.ToolTipText = Me.Controls(strCtrl).TopMonthView1.Left = Me.Controls(strCtrl).LeftMonthView1.Visible = TrueEnd SubPrivate Sub Text4_Click()strCtrl = "Text4"MonthView1.ToolTipText = Me.Controls(strCtrl).TopMonthView1.Left = Me.Controls(strCtrl).LeftMonthView1.Visible = TrueEnd Sub


The save command is :


VB Code:
Private Sub saveCmnd2_Click()Data1.Recordset.Fields("orders") = DBCombo1.TextData1.Recordset.Fields("ord_dt") = CDate(Text1.Text)Data1.Recordset.Fields("art_dt") = CDate(Text3.Text)Data1.Recordset.Fields("y_po") = CDate(Text4.Text)Data1.Recordset.UpdateEnd Sub


Please guide.

Date Field
Hi I was wondering is there a way to truncate a field which has the date and time.

example
7/8/2004 02:35:01pm

to
7/8/2004

I have a field where the user selects the date but its storing date and time. I would like to only save the date???


Rob

Date() Field
I have set a database up and require it to be run on another machine. All is fine except that the date field which I want to show the sys date come up with the error #Name?. This only happens on the second machine, all is fine when I run the Db on my machine. What could be causing this, font?

Date Field
Can anyone tell me how I would code a date of 12/01/02 to just grab the
first 2 (12) then add the (/02) to it I need to strip out the middle part?
Thanks

Getting Day In Date Field
How in Access 2000 can I get the DAY in the date field. The dates are formed EITHER 00/00/0000 or 0/00/0000. I just want the middle two for a separate day field. If I use left or right of course it won't work.

How do I use instr in an ACCESS query to pull out what is between the / 12 /. (I would just want the 12 for the day for example)?

Thanks for any direction!

Date Field
datInsuredDOB is a date
"UPDATE tblTransaction Set " & _
"Trans_dtmInsuredDOB=" & IIf(datInsuredDOB = 0, #1/1/100#, datInsuredDOB) WHERE Trans_intTransID = " & Str(m_TransID)

i check if datInsuredDOB=0 then #1/1/100# else datInsuredDOB
Why after update InsuredDOB field is =to 01/01/1900 how to put null in Date Field ????
Thanks

Date Field:
Hi,

Database Gurus, may be too naive question but facing a problem with Date field when generating report(Crystal reports) on oracle database. Since oracle stores even TIME in date data type, so when users just enter time the report displays the field as 30-dec-1899 with year as "1899".

Configuration:
Vb5.0
Nt4.0 Workstation
Oracle 7.3.4

My question is:
1)How is that for this timestamp field I am facing a problem with century?.
2)In my database tables I do have date fields but their I don't get any problem with century when printing or querying database.
3)Have any one else encountered such a problem? Am I missing something.

Any help and early reply will be much appreciated.

Regards & Thanks.

URGENT : Format Of Password Field In Access Database
Hi all,

i have a problem in vb6.i m using access database as backend and storeing the new user in the table. table name is Set_pass.if i m store password "vijay" then it store in database as it is like vijay.But i want to store password in to access database any other format like * or binery formet or any unread format. I hope all of u guys understend my problem.plzzzz help me.

i want to store password into access database like
¯”Ê™¿³~ùdW§'R›ÓnžA®ùð
**********
or any other format

plzzzzzzzzz provied me solution which decode the value from database and encode the value from text box



thankx in advance

Cannot Find Field 'Date'
Hi,
I have a form in ms access.
It has a field called TicketDate and a button called GetDate.
When you click GetDate there is a onclick action defined to do the following.

TicketDate = Date

that's the whole function.

Oh noble ones please tell me why I get the error "cannot find field 'Date'"

I'm using Windows2000 pro.

Thanks,
-munch

Clear A Date Field
I have an Access field as a Date/Time type, and I have a value of 31/06/02 in there. In VB, how do I clear this field so it has nothing in it. For text fields, I can just set that field equal to "", but it doesnt seem to work for dates.

I have also tried CVDate(0), but this just sets the date equal to 0, which isnt what I want. I want the field to be emptied. The Null function also doesnt seem to want to work.

Any ideas?

Comparing A Date Field
I am trying to comapre a date coming from Access with a date value entered by a user.
I noticed that the date being entered by the user is done so via a text box, which stores the value as a String. The field in the database is a date field.
Can I compare these values the way they are, or do I have to move the date field into a string field or vice versa?
The reason I ask is because when the code to compare the dates
runs nothing seems to work.
Here's a generic example.

Lets say FileDate = 01/01/2001
Lets Say PromptDate = "01/01/2001"

If FileDate = PromptDate Then
msgbox " The dates are equal"
Else
msgbox " The dates are not equal"
End If

If this code was in my program, I would always get the message saying "The Dates are not equal"

Is there a way to better compare dates?

Querying A Date Field
Hello I am trying to construct a query to query a datefield in access.

if i use '<' or ' >' then the query works fine.But if i use = it dosent give me any accurate reults. Any idea why ?

My query is
Select * from Deal where Marketer='Z03986' AND TransactionDate< #7/18/2003#

This works but if i substitute < with = it dosent work.

thanks
Sam

How To Ask A For A Date In A Recordset´s Field ??
Hola,

I tried this in an Access 2002 Modul, to ask for a special date, in a special ADODB.Recordset:

rstPAM.MoveFirst

For i = 0 To rstPAM.RecordCount - 1

WV = Format(rstPAM!Wiedervorlage, "dd.mm.yyyy")

If WV = '01.01.2001' Then

rstPAM!Wiedervorlage = Null

End If

rstPAM.MoveNext
Next

But the If - clasue is always wrong. I don´t know what to do !! I couldn´t find anything in MSDN or the Forum.

Please help

CR9-DDF Date Field Problem?
CR9-DDF date field problem?
-----------------------------
Hi

I designed a report using Data Definition File. I put date field during design time. But, during runtime date field is not showing data from recordset. Other fields are fine.

How to use date field from DDF, without getting problem during run-time?

Date Time Field
I have a table field that store date and time in the format of yyyy/mm/dd hh:mm:ss, how can i select the date only ?

Splitting A Date Field
In an access table called "billPer" I have a date field called "endDate". endDate is defined with a "date" format. I need to see if anywhere in this table, in a leap year, I have a date with a value of "02/28/yyyy. If so, I want to change it to "02/29/yyyy where yyyy equals the leap year found in endDate. This is a DAO recordset, and I know how to open the database but I don't know how to isolate the mm and dd properties. I did something similar to this last week but that date field was defined as a string. This is different and I am using vb6.

Date Field In MDB Databse
Hello all!

I have two "identical" MDB database; but i have found one problem:

In MDB1.mdb one date field called ENTRADA returns direfents results in a query.
In a same PC MDB1 acepts this code:



Code:
Set RS = DB.OpenRecordset("SELECT ENTRADA FROM ORDEMS WHERE ORDEMS.ENTRADA>#Jan/31/2007# ORDER BY ENTRADA")


But, replacing MDB1 for MDB2 this code returns ERR=3075 (Sintax error).

I have see the table and field properties, but i can't see any diferences...


whats wrong?

Question About Date Field?
Hi,

I use date picker to let user pick the date and use that date to get a recordset from the SQL server and the field that I try to compare in SQL is defined as datetime stamp field. Do I have convert the dtpicker.value to date format first in order to compare the datetime stamp field in SQL server?

If yes, how to convert the dtpicker1.value field to date format?

Also, in MS access , i need to put # date # in the sql statement, but how about in SQL server? is the synax is different for compare the date field?

thanks!

Add Months To A Date Field
Hello all,

Is there an easy way to add months to a date field?

Example:
This code adds 15 days to begin_date.
----------------------
dim Begin_Date, End_Date as Date

Begin_Date = Date

End_Date = Begin_Date + 15
---------------------

What I want is to add months or years to begin_date in a simple way...


Is that possible??

Problem With Date Field
Hi,
When i am trying to update the date field with some date value in the form, it is not getting saved in the exact format which i have given. Please help me out.

conn.Execute ("update RoomMap_Mstr set Status_Flag='N',Reserved='N',Trans_Code=" & txtTransCode & ",CheckOut_Date=" & format(txtCheckOutDate.Text,"DD-MM-YYYY") & " where Loc_Code=" & txtLocCode & " and Suite_Code=" & txtSueitCode.Text & " and Floor_Code=" & txtFloorCode.Text & " and Room_Code=" & cboroom & " ") & "and SubRoom_Code=" & fgSubRoom.TextMatrix(i, 1)

for ex: checkout date: 29/05/2006
but getting inserted as 29/dec/1989 which is junk value.

regards
Hiran

How To Set A Date Field To Null
Can someone please tell me how to set a date or a time field in ACCESS database to a null, meaning I want to see it BLANK.

I am trying to set it to vbNull or just NULL but what I see is 12/31/1899. Is there a way to leave it blank.

Update payments set Next_date = vbNull
where C_id = 3

this way I am seeing 12/31/1899, but I want to set it to blank.

thanks.

Date Field In Vb6 Programme
Hello there,

I am using a programme written in VB6 and I want to change a simple text field to a date field (I have no knowledge on VB or any other language, I can simply make easy changes to this programme).

What I would like is to have a drop-down menu in its place with the following properties (when clicked):
1. have nothing ("") as a start value
2. show dates (as a list) like this: 06 March 2006, Monday
3. always show today's date as a starting value (not the days before that)
4. when a value is selected other than the start value ("") a reminder should pop up (this reminder already exists so all that needs to be done here is call this: frmSetReminder1.Show

Is that possible to make? If yes, where can I find info on how to do this?

Thank you for everything,

Gina

Date Field In UK Format
Dear gurus,

I have been trying to solve this problem since this morning. Hope to get some help from here.

I have written a web application and the database that I'm using is mySQL. I have a field called LOG and is declared as a varchar. This LOG field is been filled up by using NOW() function. The value in the LOG field looks something like this "02/08/06 10:24:23 PM". This format is actually American.

My problem is how to display the LOG field in this format "08/02/06 10:24:23 PM". (British format). I have also tried to change the region settings in the server. But it does not work.

Any idea?

Regards.
Kent

Insert Date Field In Vb 6
Hello there,
first of all let me make clear that I have never used VB before but I have a programme and I am trying to make some changes to it as the programmer is no longer available.

What I have is a text field "txtdateoftoday" in my main form which I would like to show current date and time in the following format (more or less):
Saturday 10.12.2005, 17:10
as soon as the form starts running.

Is that possible and if yes how? I have tried the programme's help but it has been really hard for me.

Thank you for everything.

Georgina

Copyright © 2005-08 www.BigResource.com, All rights reserved