473,385 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to use the date type in the following code or correct the code below

seshu
156 100+
hi everybody
this is seshu i have problem in formating the date actualy the data base iam using is mysql which is following yyyy-mm-dd format where as in my front end ie vb.net the date format is different for that reason i wrote my code like this

Expand|Select|Wrap|Line Numbers
  1. dim sdt as date 
  2. dim str as string
  3. sdt =datetimepicker1.text 
  4. textbox1.text=format(sdt,yyyy-MM-dd)
  5. str="select EmpID,EmpName,EmpLogin,EmpLogout,EmpLogDate,status from checkout where EmpID = '" & ComboBox1.Text & "','" & TextBox1.Text & "' < EmpLogDate < '" & TextBox2.Text & "'"
  6. Dim myda As New Odbc.OdbcDataAdapter(str, myconnection)
  7.         Dim myds As New DataSet
  8.         myds.Clear()
  9.         myda.Fill(myds, "checkout")
  10.         DataGridView1.DataSource = myds.Tables(0)
now when i execute this it is showing error near where clause
but i wrote the same code with connection string
empdate=current_date there it is working well so i came to a conclution that is is problem with date type or the format some one please help me out
regards
seshu
Jan 19 '07 #1
1 1252
iburyak
1,017 Expert 512MB
Check maybe this will help

[PHP]str="select EmpID,EmpName,EmpLogin,EmpLogout,EmpLogDate,status
from checkout
where EmpID = '" & ComboBox1.Text & "' and EmpLogDate between '" & TextBox1.Text & "' and '" & TextBox2.Text & "'"[/PHP]
Jan 19 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Don | last post by:
Hi all, With regards to the following, how do I append the datetimestamp to the filenames in the form? The files are processed using the PHP script that follows below. Thanks in advance,...
7
by: Richiep | last post by:
I am trying to get a UK format date of dd/mm/yyyy. Why does the following subroutine not return a valid date in a web form? The date returned is #12:00:00 AM# but the date I entered into the...
5
by: cmdolcet69 | last post by:
How can i format a Julian day and only the single digit in the year. I only wnat the julian day and the last digit of the year (7) For example the code below i thought would do this however i...
30
by: fniles | last post by:
On my machine in the office I change the computer setting to English (UK) so the date format is dd/mm/yyyy instead of mm/dd/yyyy for US. This problem happens in either Access or SQL Server. In the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.