473,662 Members | 2,637 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

search value from table by date

23 New Member
hi,All thanks in advance. i need a help.
i am working with a sql server 2005 database. where a table contains data like INTNO, name, dateofpurchase , item
now i want to search the value based on name and dateofpurchase fields. but not value is retrieving. i don't know what is happening.

here is the code i am using.

<code>
select INTNO from Point_item_mast er where PointName='ABC' and Date='1/12/2010'
</code>

PLEASE HELP

NEEL
Jan 14 '11 #1
12 1872
guillermobytes
77 New Member
hi,
how do you store your dates in mysql : as a string or as a date?
what does it return if you make the same query without date in the where clause?
Jan 14 '11 #2
neelmukhopadhya
23 New Member
i am using MS sql server 2005. and i am storing as a date.
and if i make query without date it is running fine.
but when i am using date it is not returning any value.

Regards
Neel
Jan 14 '11 #3
Rabbit
12,516 Recognized Expert Moderator MVP
Well, first, you used the field name Date in your SQL statement but your post says the field is named dateofpurchase.
Jan 14 '11 #4
neelmukhopadhya
23 New Member
datatype of the field is Datetime. and the column name is purchasedate as an example, You can take this as Date as the coulmn name.
Jan 14 '11 #5
guillermobytes
77 New Member
have you tried with your date formatted as '2010-01-12'
Jan 14 '11 #6
neelmukhopadhya
23 New Member
yes , i have used it.
but no result
Jan 14 '11 #7
Rabbit
12,516 Recognized Expert Moderator MVP
Have you tried using CONVERT() to make it a date time?
Jan 14 '11 #8
neelmukhopadhya
23 New Member
yes i have used it, but same result. Can you give me an example
Jan 14 '11 #9
Rabbit
12,516 Recognized Expert Moderator MVP
Expand|Select|Wrap|Line Numbers
  1. WHERE dateField = CONVERT(datetime, '1/1/2009')
Jan 14 '11 #10

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

Similar topics

0
4219
by: Q. John Chen | last post by:
Using MySQL control center, I created a MySQL database table with a column of Date type. It always give the a Default value (0000-00-00) even null is allowed. I tried remove the default value and it comes back by itself. So if I don't supply a value when insert, the default is used. Query IS NOT NULL will not exclude this record. Now, In VB (with ADO/MyOLEDB), I did the exact query trying to filter out the null record. But I still get...
1
1846
by: gostroff | last post by:
Hi, I have a lot of sample records done on different dates. It's easy to get the maximum value for any sample parameter for any sample location, but what if I want the date it was found? For example, if I have a thousand locations and 20 parameters measured at each loocation, and this sampling went on every day for a year, I want to get the maximum value for each parameter at each location, AND I want the data on which the maximum...
2
2783
by: Enosh Chang | last post by:
Hi all, I have a question about optional parameter. If I use optional parameter, it ask me to set default value for it. How can I set default value for Date parameter? Thanks! Best Regards
2
9566
by: yxq | last post by:
There are 8 bytes binary value stored date and time in Registry. 84 8B D7 DF 8B 28 C5 01 I want to convert the binary value to date using VB.NET. Dim a As FILETIME a.dwHighDateTime = 29698187 '(01C5288B to decimal) a.dwLowDateTime = -539522172 '(??????? by 84 8B D7 DF) MsgBox (GetFileToSystemDate(a, False))
1
8522
by: hemant123 | last post by:
Hi I am trying to insert null value in date field using vbasic textbox.I tried various options but failed.Please tell me the solution. Thanks in advance. Hemant
1
1472
by: jane2007 | last post by:
Hello, Here is my current code ... Dim rstStk As Recordset Set rstStk = CurrentDb.OpenRecordset("Select * from stk where PartNum = '" & strPrt & "'") The problem with this code is that i get a run time error if no record is found. How can i search the table differently where i can add a conditional statement so if no record is found, my code can do sometime else. I really do need help. Thanks.
0
1670
by: coolvivek33 | last post by:
hi i am facing a strange problem i am trying to build report using sql server 2005 and microsoft visual studio2005 now it is in requirement that i should seperate date from time.I have done that using visual studio with following code on one of the dataset values with the help of following code SELECT Convert(varchar, Deliverydate, 103) as displayValue FROM TimePeriodOrderDeliveryDate.This only dispalys the date part from the ate time...
7
2260
by: metalheadstorm | last post by:
God this is annoying me, im sorry if this has been asked before but ive looked though the forum and the net but my searches havent come up woth anything.... mainly due to that i dont really know what to search for. So here we go, i have a table in access called hopper that hold some info about a feed hopper ( max volume , feed_ID etc) i also have a table called feed which holds "feed_ID , Catagory" now i want to be able to add a...
1
1970
by: codferrow | last post by:
Hello, I have a small issue with a web-search engine I'm working on. The main table is constantly growing (1 insert per second, currently 150 000 records) and it has full-text indexes on 2 fields that contain over 20 000 characters on each row. The thing is, as I could observe, that when multiple different full-text searches are made in appropiate period of time, the query doesn't take so much to respond (though i couldn't quite say it's...
5
1592
by: Greg (codepug | last post by:
I have a table that contains a field called RDATE (reminder date). Dates are optionally entered to remind a user of an upcoming event. I have a reminder button that launches a popup form, and a list of all the reminder fields that actually contain dates and a corresponding explanation, pops up. This is handled by a query. I created a backlight to the button that will light when a reminder date is coming up. How do I check the table on...
0
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8547
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7368
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4181
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1754
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.